Kea 2.7.6
|
Houses the composite key that uniquely identifies a duration: More...
#include <monitored_duration.h>
Public Member Functions | |
DurationKey (uint16_t family, uint8_t query_type, uint8_t response_type, const std::string &start_event_label, const std::string &stop_event_label, dhcp::SubnetID subnet_id) | |
Constructor. | |
virtual | ~DurationKey ()=default |
Destructor. | |
uint16_t | getFamily () |
Get protocol family. | |
std::string | getLabel () const |
Get a composite label of the member values with text message types. | |
uint8_t | getQueryType () const |
Get the query packet type. | |
uint8_t | getResponseType () const |
Get the response packet type. | |
std::string | getStartEventLabel () const |
Get the start event label. | |
std::string | getStatName (const std::string &value_name) const |
Get the StatsMgr formatted compatible name. | |
std::string | getStopEventLabel () const |
Get the end event label. | |
dhcp::SubnetID | getSubnetId () const |
Get the subnet id. | |
bool | operator!= (const DurationKey &other) const |
Inequality operator. | |
bool | operator< (const DurationKey &other) const |
Less than operator. | |
bool | operator== (const DurationKey &other) const |
Equality operator. | |
void | setSubnetId (dhcp::SubnetID subnet_id) |
Set the subnet id. | |
virtual data::ElementPtr | toElement () const |
Renders the the duration key as an Element. | |
Public Member Functions inherited from isc::data::CfgToElement | |
virtual | ~CfgToElement () |
Destructor. | |
Static Public Member Functions | |
static std::string | getMessageTypeLabel (uint16_t family, uint16_t msg_type) |
Get a label for a family-specific message type (e.g. | |
static void | validateMessagePair (uint16_t family, uint8_t query_type, uint8_t response_type) |
Validates that a query and response message type pair is sane. | |
Protected Attributes | |
uint16_t | family_ |
Protocol family AF_INET or AF_INET6. | |
uint8_t | query_type_ |
Query message type (e.g. DHCPDISCOVER, DHCP6_SOLICIT). | |
uint8_t | response_type_ |
Response message type (e.g. DHCPOFFER, DHCP6_ADVERTISE). | |
std::string | start_event_label_ |
Label of the start event which begins the duration. | |
std::string | stop_event_label_ |
Label of the end event which ends the duration. | |
isc::dhcp::SubnetID | subnet_id_ |
Subnet ID of the subnet selected during query fulfillment. | |
Houses the composite key that uniquely identifies a duration:
Definition at line 134 of file monitored_duration.h.
isc::perfmon::DurationKey::DurationKey | ( | uint16_t | family, |
uint8_t | query_type, | ||
uint8_t | response_type, | ||
const std::string & | start_event_label, | ||
const std::string & | stop_event_label, | ||
dhcp::SubnetID | subnet_id ) |
Constructor.
family | protocol family AF_INET or AF_INET6 |
query_type | message type of the query packet |
response_type | message type of the response packet |
start_event_label | label of the start event |
stop_event_label | label of the end event |
subnet_id | id of the selected subnet |
Definition at line 66 of file monitored_duration.cc.
References isc_throw, and validateMessagePair().
|
virtualdefault |
Destructor.
|
inline |
Get protocol family.
Definition at line 154 of file monitored_duration.h.
References family_.
std::string isc::perfmon::DurationKey::getLabel | ( | ) | const |
Get a composite label of the member values with text message types.
The format of the string:
Definition at line 172 of file monitored_duration.cc.
References family_, getMessageTypeLabel(), query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.
Referenced by isc::perfmon::MonitoredDuration::expireCurrentInterval(), and isc::perfmon::operator<<().
|
static |
Get a label for a family-specific message type (e.g.
"DHCPDISCOVER", "SOLICIT")
family | Protocol family of the key (AF_INET or AF_INET6) |
msg_type | numeric message type to translate |
Definition at line 163 of file monitored_duration.cc.
References isc::dhcp::DHCP_NOTYPE, DHCPV6_NOTYPE, isc::dhcp::Pkt4::getName(), and isc::dhcp::Pkt6::getName().
Referenced by getLabel(), getStatName(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().
|
inline |
Get the query packet type.
Definition at line 161 of file monitored_duration.h.
References query_type_.
|
inline |
Get the response packet type.
Definition at line 168 of file monitored_duration.h.
References response_type_.
|
inline |
Get the start event label.
Definition at line 175 of file monitored_duration.h.
References start_event_label_.
std::string isc::perfmon::DurationKey::getStatName | ( | const std::string & | value_name | ) | const |
Get the StatsMgr formatted compatible name.
value_name | name of the specific value (e.g. "mean-usecs", "min-duration-usecs"). The format of the string: |
Definition at line 184 of file monitored_duration.cc.
References family_, getMessageTypeLabel(), query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.
|
inline |
Get the end event label.
Definition at line 182 of file monitored_duration.h.
References stop_event_label_.
|
inline |
Get the subnet id.
Definition at line 189 of file monitored_duration.h.
References subnet_id_.
bool isc::perfmon::DurationKey::operator!= | ( | const DurationKey & | other | ) | const |
Inequality operator.
Inequality operator to compare two DurationKey objects.
other | DurationKey to be compared against. |
Definition at line 223 of file monitored_duration.cc.
bool isc::perfmon::DurationKey::operator< | ( | const DurationKey & | other | ) | const |
Less than operator.
less than operator to compare two DurationKey objects.
other | DurationKey to be compared against. |
Definition at line 227 of file monitored_duration.cc.
References query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.
bool isc::perfmon::DurationKey::operator== | ( | const DurationKey & | other | ) | const |
Equality operator.
equality operator to compare two DurationKey objects.
other | DurationKey to be compared against. |
Definition at line 212 of file monitored_duration.cc.
References query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.
|
inline |
Set the subnet id.
subnet_id | new value for subnet id. |
Definition at line 196 of file monitored_duration.h.
References subnet_id_.
|
virtual |
Renders the the duration key as an Element.
The element will appear as follows:
Implements isc::data::CfgToElement.
Reimplemented in isc::perfmon::MonitoredDuration.
Definition at line 201 of file monitored_duration.cc.
References isc::data::Element::create(), isc::data::Element::createMap(), family_, getMessageTypeLabel(), query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.
Referenced by isc::perfmon::MonitoredDuration::toElement().
|
static |
Validates that a query and response message type pair is sane.
family | Protocol family of the key (AF_INET or AF_INET6) The format of the string: |
query_type | message type of the query packet |
response_type | message type of the response packet |
BadValue | is the pairing does not make sense. |
Definition at line 86 of file monitored_duration.cc.
References isc::dhcp::DHCP_NOTYPE, isc::dhcp::DHCPACK, isc::dhcp::DHCPDISCOVER, isc::dhcp::DHCPINFORM, isc::dhcp::DHCPNAK, isc::dhcp::DHCPOFFER, isc::dhcp::DHCPREQUEST, DHCPV6_ADVERTISE, DHCPV6_CONFIRM, DHCPV6_NOTYPE, DHCPV6_REBIND, DHCPV6_RENEW, DHCPV6_REPLY, DHCPV6_REQUEST, DHCPV6_SOLICIT, isc::dhcp::Pkt4::getName(), isc::dhcp::Pkt6::getName(), and isc_throw.
Referenced by DurationKey(), and isc::perfmon::PerfMonMgr::processPktEventStack().
|
protected |
Protocol family AF_INET or AF_INET6.
Definition at line 299 of file monitored_duration.h.
Referenced by getFamily(), getLabel(), getStatName(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().
|
protected |
Query message type (e.g. DHCPDISCOVER, DHCP6_SOLICIT).
Definition at line 302 of file monitored_duration.h.
Referenced by getLabel(), getQueryType(), getStatName(), operator<(), operator==(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().
|
protected |
Response message type (e.g. DHCPOFFER, DHCP6_ADVERTISE).
Definition at line 305 of file monitored_duration.h.
Referenced by getLabel(), getResponseType(), getStatName(), operator<(), operator==(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().
|
protected |
Label of the start event which begins the duration.
Definition at line 308 of file monitored_duration.h.
Referenced by getLabel(), getStartEventLabel(), getStatName(), operator<(), operator==(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().
|
protected |
Label of the end event which ends the duration.
Definition at line 311 of file monitored_duration.h.
Referenced by getLabel(), getStatName(), getStopEventLabel(), operator<(), operator==(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().
|
protected |
Subnet ID of the subnet selected during query fulfillment.
Definition at line 314 of file monitored_duration.h.
Referenced by getLabel(), getStatName(), getSubnetId(), operator<(), operator==(), setSubnetId(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().