![]() |
Kea
1.5.0
|
Statistics context. More...
#include <context.h>
Public Member Functions | |
| void | add (const ObservationPtr &obs) |
| Adds a new observation. More... | |
| bool | del (const std::string &name) |
| Attempts to delete an observation. More... | |
| ObservationPtr | get (const std::string &name) const |
| attempts to get an observation More... | |
Public Attributes | |
| std::map< std::string, ObservationPtr > | stats_ |
| Statistics container. More... | |
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 24 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 35 of file context.cc.
References stats_.
| ObservationPtr isc::stats::StatContext::get | ( | const std::string & | name | ) | const |
attempts to get an observation
| name | name of the statistic |
Definition at line 15 of file context.cc.
References stats_.
| std::map<std::string, ObservationPtr> isc::stats::StatContext::stats_ |
Statistics container.
It is public to allow various operations that require iterating over all elements. In particular, two operations (setting all stats to 0; reporting all stats) will take advantage of this. Alternatively, we could make it protected and then return a pointer to it, but that would defeat the purpose of the hermetization in the first place.