Kea 2.7.5
|
Statistics context. More...
#include <context.h>
Public Member Functions | |
void | add (const ObservationPtr &obs) |
Adds a new observation. | |
void | clear () |
Removes all observations. | |
bool | del (const std::string &name) |
Attempts to delete an observation. | |
ObservationPtr | get (const std::string &name) const |
Attempts to get an observation. | |
isc::data::ConstElementPtr | getAll () const |
Returns a map with all observations. | |
void | resetAll () |
Resets all observations. | |
void | setMaxSampleAgeAll (const StatsDuration &duration) |
Sets duration for all observations. | |
void | setMaxSampleCountAll (uint32_t max_samples) |
Sets max sample count for all observations. | |
size_t | size () |
Returns the number of observations. | |
Statistics context.
Statistics context is essentially a container used to group statistics related to a given context together. Two examples of such contexts are all statistics related to a given subnet or all statistics related to a given network interface.
void isc::stats::StatContext::add | ( | const ObservationPtr & | obs | ) |
Adds a new observation.
obs | observation to be added |
DuplicateStat | if an observation with the same name exists already |
Definition at line 30 of file context.cc.
References isc_throw.
void isc::stats::StatContext::clear | ( | ) |
Removes all observations.
Definition at line 56 of file context.cc.
bool isc::stats::StatContext::del | ( | const std::string & | name | ) |
Attempts to delete an observation.
name | name of the observation to be deleted |
Definition at line 41 of file context.cc.
ObservationPtr isc::stats::StatContext::get | ( | const std::string & | name | ) | const |
Attempts to get an observation.
name | name of the statistic |
Definition at line 21 of file context.cc.
ConstElementPtr isc::stats::StatContext::getAll | ( | ) | const |
Returns a map with all observations.
Definition at line 70 of file context.cc.
References isc::data::Element::createMap().
void isc::stats::StatContext::resetAll | ( | ) |
Resets all observations.
Definition at line 61 of file context.cc.
void isc::stats::StatContext::setMaxSampleAgeAll | ( | const StatsDuration & | duration | ) |
Sets duration for all observations.
duration | value to be set for all observations |
Definition at line 90 of file context.cc.
void isc::stats::StatContext::setMaxSampleCountAll | ( | uint32_t | max_samples | ) |
Sets max sample count for all observations.
max_samples | value to be set for all observations |
Definition at line 81 of file context.cc.
size_t isc::stats::StatContext::size | ( | ) |
Returns the number of observations.
Definition at line 51 of file context.cc.