Kea 2.7.5
isc::perfmon::DurationDataInterval Class Reference

Embodies a span of time (i.e. More...

#include <monitored_duration.h>

Public Member Functions

 DurationDataInterval (const Timestamp &start_time=dhcp::PktEvent::now())
 Constructor.
 
 ~DurationDataInterval ()=default
 Destructor.
 
void addDuration (const Duration &duration)
 Add a duration to the interval.
 
Duration getMaxDuration () const
 Get the maximum duration that has occurred in the interval.
 
Duration getMeanDuration () const
 Get the mean duration for the interval.
 
Duration getMinDuration () const
 Get the minimum duration that has occurred in the interval.
 
uint64_t getOccurrences () const
 Get the number of occurrences that have contributed to the interval.
 
const TimestampgetStartTime () const
 Get the start time of the interval.
 
Duration getTotalDuration () const
 Get the total duration in the interval.
 
bool operator== (const DurationDataInterval &other) const
 Equality operator.
 
void setStartTime (const Timestamp &start_time)
 Set the interval start time.
 

Static Public Member Functions

static const DurationZERO_DURATION ()
 Get a duration of zero.
 

Detailed Description

Embodies a span of time (i.e.

an interval) over which duration data is accumulated.

Definition at line 25 of file monitored_duration.h.

Constructor & Destructor Documentation

◆ DurationDataInterval()

isc::perfmon::DurationDataInterval::DurationDataInterval ( const Timestamp & start_time = dhcp::PktEvent::now())
explicit

Constructor.

Definition at line 26 of file monitored_duration.cc.

◆ ~DurationDataInterval()

isc::perfmon::DurationDataInterval::~DurationDataInterval ( )
default

Destructor.

Member Function Documentation

◆ addDuration()

void isc::perfmon::DurationDataInterval::addDuration ( const Duration & duration)

Add a duration to the interval.

Given a duration value:

  1. Increment the number of occurrences
  2. Add the duration to the total duration
  3. Update the minimum and/or maxium duration accordingly
Parameters
durationDuration to add.

Definition at line 33 of file monitored_duration.cc.

◆ getMaxDuration()

Duration isc::perfmon::DurationDataInterval::getMaxDuration ( ) const
inline

Get the maximum duration that has occurred in the interval.

Returns
Duration containing the maximum duration.

Definition at line 83 of file monitored_duration.h.

◆ getMeanDuration()

Duration isc::perfmon::DurationDataInterval::getMeanDuration ( ) const

Get the mean duration for the interval.

Returns
Duration containing the mean.

Definition at line 47 of file monitored_duration.cc.

References ZERO_DURATION().

+ Here is the call graph for this function:

◆ getMinDuration()

Duration isc::perfmon::DurationDataInterval::getMinDuration ( ) const
inline

Get the minimum duration that has occurred in the interval.

Returns
Duration containing the minimum duration.

Definition at line 76 of file monitored_duration.h.

◆ getOccurrences()

uint64_t isc::perfmon::DurationDataInterval::getOccurrences ( ) const
inline

Get the number of occurrences that have contributed to the interval.

Returns
the number of occurrences.

Definition at line 69 of file monitored_duration.h.

◆ getStartTime()

const Timestamp & isc::perfmon::DurationDataInterval::getStartTime ( ) const
inline

Get the start time of the interval.

Returns
Timestamp containing the start time.

Definition at line 54 of file monitored_duration.h.

◆ getTotalDuration()

Duration isc::perfmon::DurationDataInterval::getTotalDuration ( ) const
inline

Get the total duration in the interval.

Returns
Duration containing the total duration.

Definition at line 90 of file monitored_duration.h.

◆ operator==()

bool isc::perfmon::DurationDataInterval::operator== ( const DurationDataInterval & other) const

Equality operator.

Primarily used for testing.

equality operator to compare two DurationDataInterval objects.

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

Definition at line 56 of file monitored_duration.cc.

◆ setStartTime()

void isc::perfmon::DurationDataInterval::setStartTime ( const Timestamp & start_time)
inline

Set the interval start time.

Parameters
start_timenew value for the interval start time.

Definition at line 61 of file monitored_duration.h.

◆ ZERO_DURATION()

static const Duration & isc::perfmon::DurationDataInterval::ZERO_DURATION ( )
inlinestatic

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