Kea 2.6.2
isc::perfmon::MonitoredDuration Class Reference

#include <monitored_duration.h>

+ Inheritance diagram for isc::perfmon::MonitoredDuration:

Public Member Functions

 MonitoredDuration (const DurationKey &key, const Duration &interval_duration)
 Constructor.
 
 MonitoredDuration (const MonitoredDuration &rhs)
 Copy Constructor.
 
 MonitoredDuration (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, const Duration &interval_duration)
 Constructor.
 
virtual ~MonitoredDuration ()=default
 Destructor.
 
bool addSample (const Duration &sample)
 Add a sample to the duration's current interval.
 
void clear ()
 Deletes the current and previous intervals.
 
void expireCurrentInterval ()
 Concludes the current interval.
 
DurationDataIntervalPtr getCurrentInterval () const
 Get the current interval.
 
Timestamp getCurrentIntervalStart () const
 Get the current interval start time.
 
Duration getIntervalDuration () const
 Get the interval duration.
 
DurationDataIntervalPtr getPreviousInterval () const
 Get the previous interval.
 
- Public Member Functions inherited from 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.
 
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from isc::perfmon::DurationKey
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 inherited from isc::perfmon::DurationKey
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

Definition at line 304 of file monitored_duration.h.

Constructor & Destructor Documentation

◆ MonitoredDuration() [1/3]

isc::perfmon::MonitoredDuration::MonitoredDuration ( 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,
const Duration & interval_duration )

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
interval_durationthe interval duration

Definition at line 230 of file monitored_duration.cc.

References isc::perfmon::DurationKey::DurationKey(), isc_throw, and isc::perfmon::DurationDataInterval::ZERO_DURATION().

Referenced by MonitoredDuration().

+ Here is the call graph for this function:

◆ MonitoredDuration() [2/3]

isc::perfmon::MonitoredDuration::MonitoredDuration ( const DurationKey & key,
const Duration & interval_duration )

Constructor.

Parameters
keycomposite key that identifies the alarm
interval_durationthe interval duration

Definition at line 247 of file monitored_duration.cc.

References isc::perfmon::DurationKey::DurationKey(), isc_throw, and isc::perfmon::DurationDataInterval::ZERO_DURATION().

+ Here is the call graph for this function:

◆ MonitoredDuration() [3/3]

isc::perfmon::MonitoredDuration::MonitoredDuration ( const MonitoredDuration & rhs)

Copy Constructor.

Parameters
rhsduration to copy

Definition at line 259 of file monitored_duration.cc.

References isc::perfmon::DurationKey::DurationKey(), MonitoredDuration(), and if().

+ Here is the call graph for this function:

◆ ~MonitoredDuration()

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

Destructor.

Member Function Documentation

◆ addSample()

bool isc::perfmon::MonitoredDuration::addSample ( const Duration & sample)

Add a sample to the duration's current interval.

If there is no current interval start a new one otherwise if the current interval has expired move it to the previous interval, set the return flag to true, then start a new interval. Add the sample to the current interval.

Parameters
sampleduration value to add
Returns
True if there is a newly completed (i.e. previous) interval to report.

Definition at line 280 of file monitored_duration.cc.

References isc::dhcp::PktEvent::now().

+ Here is the call graph for this function:

◆ clear()

void isc::perfmon::MonitoredDuration::clear ( )

Deletes the current and previous intervals.

Definition at line 307 of file monitored_duration.cc.

◆ expireCurrentInterval()

void isc::perfmon::MonitoredDuration::expireCurrentInterval ( )

Concludes the current interval.

Rotates current interval to previous and resets curent interval to empty.

Exceptions
InvalidOperationif there is no current interval.

Definition at line 296 of file monitored_duration.cc.

References isc::perfmon::DurationKey::getLabel(), and isc_throw.

+ Here is the call graph for this function:

◆ getCurrentInterval()

DurationDataIntervalPtr isc::perfmon::MonitoredDuration::getCurrentInterval ( ) const
inline

Get the current interval.

Returns
Pointer to the current interval if it exists or an empty pointer.

Definition at line 350 of file monitored_duration.h.

◆ getCurrentIntervalStart()

Timestamp isc::perfmon::MonitoredDuration::getCurrentIntervalStart ( ) const

Get the current interval start time.

Returns
Current interval's start time or MIN_TIME if there's no current interval.

Definition at line 274 of file monitored_duration.cc.

References isc::dhcp::PktEvent::MIN_TIME().

+ Here is the call graph for this function:

◆ getIntervalDuration()

Duration isc::perfmon::MonitoredDuration::getIntervalDuration ( ) const
inline

Get the interval duration.

Returns
Duration containing the interval duration.

Definition at line 336 of file monitored_duration.h.

◆ getPreviousInterval()

DurationDataIntervalPtr isc::perfmon::MonitoredDuration::getPreviousInterval ( ) const
inline

Get the previous interval.

Returns
Pointer to the previous interval if it exists or an empty pointer.

Definition at line 343 of file monitored_duration.h.


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