Kea 2.7.0
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.
 
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.
 

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 134 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 66 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 154 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 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<<().

+ 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 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().

+ 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 161 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 168 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 175 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. "mean-usecs", "min-duration-usecs"). 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.mean-usecs
subnet[9].perfmon.discover-offer.socket_received-buffer_read.mean-usecs
Returns
the statistic name.

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_.

+ 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 182 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 189 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 223 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 227 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 212 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 196 of file monitored_duration.h.

References subnet_id_.

◆ toElement()

ElementPtr isc::perfmon::DurationKey::toElement ( ) const
virtual

Renders the the duration key as an Element.

The element will appear as follows:

{
"query-type": "discover",
"response-type": "offer",
"start-event": "socket_received",
"stop-event": "buffer_read",
"subnet-id": 10
}
Returns
Element::map containing the duration key values.

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().

+ Here is the call graph for this function:

◆ 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 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().

+ 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 299 of file monitored_duration.h.

Referenced by getFamily(), getLabel(), getStatName(), toElement(), and isc::perfmon::MonitoredDuration::toValueRow().

◆ query_type_

uint8_t isc::perfmon::DurationKey::query_type_
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().

◆ response_type_

uint8_t isc::perfmon::DurationKey::response_type_
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().

◆ start_event_label_

std::string isc::perfmon::DurationKey::start_event_label_
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().

◆ stop_event_label_

std::string isc::perfmon::DurationKey::stop_event_label_
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().

◆ subnet_id_

isc::dhcp::SubnetID isc::perfmon::DurationKey::subnet_id_
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().


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