Kea 2.5.9
isc::perfmon::DurationKey Class Reference

Houses the composite key that uniquely identifies a duration: More...

#include <monitored_duration.h>

+ Inheritance diagram for isc::perfmon::DurationKey:

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.
 

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.
 

Detailed Description

Houses the composite key that uniquely identifies a duration:

  1. Query Packet Type
  2. Response Packet Type
  3. Start Event
  4. Stop Event
  5. Subnet ID can be GLOBAL_SUBNET_ID for aggregate durations

Definition at line 132 of file monitored_duration.h.

Constructor & Destructor Documentation

◆ DurationKey()

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.

Parameters
familyprotocol family AF_INET or AF_INET6
query_typemessage type of the query packet
response_typemessage type of the response packet
start_event_labellabel of the start event
stop_event_labellabel of the end event
subnet_idid of the selected subnet

Definition at line 63 of file monitored_duration.cc.

References isc_throw, and validateMessagePair().

+ Here is the call graph for this function:

◆ ~DurationKey()

virtual isc::perfmon::DurationKey::~DurationKey ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getFamily()

uint16_t isc::perfmon::DurationKey::getFamily ( )
inline

Get protocol family.

Returns
uint16_t containing the family (AF_INET or AF_INET6)

Definition at line 152 of file monitored_duration.h.

References family_.

◆ getLabel()

std::string isc::perfmon::DurationKey::getLabel ( ) const

Get a composite label of the member values with text message types.

The format of the string:

<query type>-<response type>.<start_event>-<stop_event>.<subnet id>
Example:
"DHCPDISCOVER-DHCPOFFER.socket_received.buffer_read.12"
or
"SOLICIT-ADVERTISE.socket_received.buffer_read.12"
Returns
the composite label.

Definition at line 169 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<<().

+ Here is the call graph for this function:

◆ getMessageTypeLabel()

std::string isc::perfmon::DurationKey::getMessageTypeLabel ( uint16_t  family,
uint16_t  msg_type 
)
static

Get a label for a family-specific message type (e.g.

"DHCPDISCOVER", "SOLICIT")

Parameters
familyProtocol family of the key (AF_INET or AF_INET6)
msg_typenumeric message type to translate
Returns
Text label, for values of DHCP_NOTYPE or DHCPV6_NOTYPE: "*"

Definition at line 160 of file monitored_duration.cc.

References isc::dhcp::DHCP_NOTYPE, DHCPV6_NOTYPE, isc::dhcp::Pkt4::getName(), and isc::dhcp::Pkt6::getName().

Referenced by getLabel(), and getStatName().

+ Here is the call graph for this function:

◆ getQueryType()

uint8_t isc::perfmon::DurationKey::getQueryType ( ) const
inline

Get the query packet type.

Returns
the query packet type.

Definition at line 159 of file monitored_duration.h.

References query_type_.

◆ getResponseType()

uint8_t isc::perfmon::DurationKey::getResponseType ( ) const
inline

Get the response packet type.

Returns
the response packet type.

Definition at line 166 of file monitored_duration.h.

References response_type_.

◆ getStartEventLabel()

std::string isc::perfmon::DurationKey::getStartEventLabel ( ) const
inline

Get the start event label.

Returns
the start event label.

Definition at line 173 of file monitored_duration.h.

References start_event_label_.

◆ getStatName()

std::string isc::perfmon::DurationKey::getStatName ( const std::string &  value_name) const

Get the StatsMgr formatted compatible name.

Parameters
value_namename of the specific value (e.g. "average-ms", "min-duration-ms"). The format of the string:
{subnet-id[x]}.perfmon.<query type>-<response type>.<start event>-<end event>.<value-name>
Examples:
perfmon.discover-offer.socket_received-buffer_read.average-ms
subnet[9].perfmon.discover-offer.socket_received-buffer_read.average-ms
Returns
the statistic name.

Definition at line 181 of file monitored_duration.cc.

References family_, getMessageTypeLabel(), query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.

+ Here is the call graph for this function:

◆ getStopEventLabel()

std::string isc::perfmon::DurationKey::getStopEventLabel ( ) const
inline

Get the end event label.

Returns
the end event label.

Definition at line 180 of file monitored_duration.h.

References stop_event_label_.

◆ getSubnetId()

dhcp::SubnetID isc::perfmon::DurationKey::getSubnetId ( ) const
inline

Get the subnet id.

Returns
SubnetID of the selected subnet.

Definition at line 187 of file monitored_duration.h.

References subnet_id_.

◆ operator!=()

bool isc::perfmon::DurationKey::operator!= ( const DurationKey other) const

Inequality operator.

Inequality operator to compare two DurationKey objects.

Parameters
otherDurationKey to be compared against.
Returns
True the keys are not equal

Definition at line 209 of file monitored_duration.cc.

◆ operator<()

bool isc::perfmon::DurationKey::operator< ( const DurationKey other) const

Less than operator.

less than operator to compare two DurationKey objects.

Parameters
otherDurationKey to be compared against.
Returns
True key is less than the other key

Definition at line 213 of file monitored_duration.cc.

References query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.

◆ operator==()

bool isc::perfmon::DurationKey::operator== ( const DurationKey other) const

Equality operator.

equality operator to compare two DurationKey objects.

Parameters
otherDurationKey to be compared against.
Returns
True the keys are equal

Definition at line 198 of file monitored_duration.cc.

References query_type_, response_type_, start_event_label_, stop_event_label_, and subnet_id_.

◆ setSubnetId()

void isc::perfmon::DurationKey::setSubnetId ( dhcp::SubnetID  subnet_id)
inline

Set the subnet id.

Parameters
subnet_idnew value for subnet id.

Definition at line 194 of file monitored_duration.h.

References subnet_id_.

◆ validateMessagePair()

void isc::perfmon::DurationKey::validateMessagePair ( uint16_t  family,
uint8_t  query_type,
uint8_t  response_type 
)
static

Validates that a query and response message type pair is sane.

Parameters
familyProtocol family of the key (AF_INET or AF_INET6) The format of the string:
query_typemessage type of the query packet
response_typemessage type of the response packet
Exceptions
BadValueis the pairing does not make sense.

Definition at line 83 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().

+ Here is the call graph for this function:

Member Data Documentation

◆ family_

uint16_t isc::perfmon::DurationKey::family_
protected

Protocol family AF_INET or AF_INET6.

Definition at line 280 of file monitored_duration.h.

Referenced by getFamily(), getLabel(), and getStatName().

◆ query_type_

uint8_t isc::perfmon::DurationKey::query_type_
protected

Query message type (e.g. DHCPDISCOVER, DHCP6_SOLICIT).

Definition at line 283 of file monitored_duration.h.

Referenced by getLabel(), getQueryType(), getStatName(), operator<(), and operator==().

◆ response_type_

uint8_t isc::perfmon::DurationKey::response_type_
protected

Response message type (e.g. DHCPOFFER, DHCP6_ADVERTISE).

Definition at line 286 of file monitored_duration.h.

Referenced by getLabel(), getResponseType(), getStatName(), operator<(), and operator==().

◆ start_event_label_

std::string isc::perfmon::DurationKey::start_event_label_
protected

Label of the start event which begins the duration.

Definition at line 289 of file monitored_duration.h.

Referenced by getLabel(), getStartEventLabel(), getStatName(), operator<(), and operator==().

◆ stop_event_label_

std::string isc::perfmon::DurationKey::stop_event_label_
protected

Label of the end event which ends the duration.

Definition at line 292 of file monitored_duration.h.

Referenced by getLabel(), getStatName(), getStopEventLabel(), operator<(), and operator==().

◆ subnet_id_

isc::dhcp::SubnetID isc::perfmon::DurationKey::subnet_id_
protected

Subnet ID of the subnet selected during query fulfillment.

Definition at line 295 of file monitored_duration.h.

Referenced by getLabel(), getStatName(), getSubnetId(), operator<(), operator==(), and setSubnetId().


The documentation for this class was generated from the following files: