22 auto obs = stats_.find(name);
23 if (obs != stats_.end()) {
31 auto existing = stats_.find(obs->getName());
32 if (existing == stats_.end()) {
33 stats_.insert(make_pair(obs->getName() ,obs));
36 <<
" already exists.");
42 auto obs = stats_.find(name);
43 if (obs != stats_.end()) {
52 return (stats_.size());
63 for (
auto s : stats_) {
73 for (
auto s : stats_) {
75 map->set(s.first, s.second->getJSON());
83 for (
auto s : stats_) {
85 s.second->setMaxSampleCount(max_samples);
92 for (
auto s : stats_) {
94 s.second->setMaxSampleAge(duration);
Exception indicating that a given statistic is duplicated.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< Observation > ObservationPtr
Observation pointer.
std::chrono::system_clock::duration StatsDuration
Defines duration type.
Defines the logger used by the top-level component of kea-lfc.
bool del(const std::string &name)
Attempts to delete an observation.
void clear()
Removes all observations.
void setMaxSampleAgeAll(const StatsDuration &duration)
Sets duration for all observations.
void resetAll()
Resets all observations.
isc::data::ConstElementPtr getAll() const
Returns a map with all observations.
void add(const ObservationPtr &obs)
Adds a new observation.
void setMaxSampleCountAll(uint32_t max_samples)
Sets max sample count for all observations.
ObservationPtr get(const std::string &name) const
Attempts to get an observation.
size_t size()
Returns the number of observations.