| Kea 3.0.2-git

lib/stats/stats_mgr.cc
Go to the documentation of this file.
1// Copyright (C) 2015-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#include <config.h>
8
9#include <exceptions/exceptions.h>
10#include <stats/stats_mgr.h>
11#include <cc/data.h>
12#include <cc/command_interpreter.h>
13#include <util/multi_threading_mgr.h>
14#include <util/bigints.h>
15
16#include <boost/make_shared.hpp>
17
18#include <chrono>
19
20 using namespace std;
21 using namespace std::chrono;
22 using namespace isc::data;
23 using namespace isc::config;
24 using namespace isc::util;
25
26 namespace isc {
27 namespace stats {
28
29 StatsMgr&
30 StatsMgr::instance() {
31 static StatsMgr stats_mgr;
32 return (stats_mgr);
33}
34
35StatsMgr::StatsMgr() :
36 global_(boost::make_shared<StatContext>()), mutex_(new mutex()) {
37}
38
39 void
40 StatsMgr::setValue(const string& name, const int64_t value) {
41 MultiThreadingLock lock(*mutex_);
42 setValueInternal(name, value);
43}
44
45 void
46 StatsMgr::setValue(const string& name, const int128_t& value) {
47 MultiThreadingLock lock(*mutex_);
48 setValueInternal(name, value);
49}
50
51 void
52 StatsMgr::setValue(const string& name, const double value) {
53 MultiThreadingLock lock(*mutex_);
54 setValueInternal(name, value);
55}
56
57 void
58 StatsMgr::setValue(const string& name, const StatsDuration& value) {
59 MultiThreadingLock lock(*mutex_);
60 setValueInternal(name, value);
61}
62
63 void
64 StatsMgr::setValue(const string& name, const string& value) {
65 MultiThreadingLock lock(*mutex_);
66 setValueInternal(name, value);
67}
68
69 void
70 StatsMgr::addValue(const string& name, const int64_t value) {
71 MultiThreadingLock lock(*mutex_);
72 addValueInternal(name, value);
73}
74
75 void
76 StatsMgr::addValue(const string& name, const int128_t& value) {
77 MultiThreadingLock lock(*mutex_);
78 addValueInternal(name, value);
79}
80
81 void
82 StatsMgr::addValue(const string& name, const double value) {
83 MultiThreadingLock lock(*mutex_);
84 addValueInternal(name, value);
85}
86
87 void
88 StatsMgr::addValue(const string& name, const StatsDuration& value) {
89 MultiThreadingLock lock(*mutex_);
90 addValueInternal(name, value);
91}
92
93 void
94 StatsMgr::addValue(const string& name, const string& value) {
95 MultiThreadingLock lock(*mutex_);
96 addValueInternal(name, value);
97}
98
99 ObservationPtr
100 StatsMgr::getObservation(const string& name) const {
101 MultiThreadingLock lock(*mutex_);
102 return (getObservationInternal(name));
103}
104
105 ObservationPtr
106 StatsMgr::getObservationInternal(const string& name) const {
108 // Currently we keep everything in a global context.
109 return (global_->get(name));
110}
111
112 void
113 StatsMgr::addObservation(const ObservationPtr& stat) {
114 MultiThreadingLock lock(*mutex_);
115 addObservationInternal(stat);
116}
117
118 void
119 StatsMgr::addObservationInternal(const ObservationPtr& stat) {
121 // Currently we keep everything in a global context.
122 global_->add(stat);
123}
124
125 bool
126StatsMgr::deleteObservation(const string& name) {
127 MultiThreadingLock lock(*mutex_);
128 return (deleteObservationInternal(name));
129}
130
131 bool
132StatsMgr::deleteObservationInternal(const string& name) {
134 // Currently we keep everything in a global context.
135 return (global_->del(name));
136}
137
138 bool
139 StatsMgr::setMaxSampleAge(const string& name, const StatsDuration& duration) {
140 MultiThreadingLock lock(*mutex_);
141 return (setMaxSampleAgeInternal(name, duration));
142}
143
144 bool
145StatsMgr::setMaxSampleAgeInternal(const string& name,
146 const StatsDuration& duration) {
147 ObservationPtr obs = getObservationInternal(name);
148 if (obs) {
149 obs->setMaxSampleAge(duration);
150 return (true);
151 }
152 return (false);
153}
154
155 bool
156 StatsMgr::setMaxSampleCount(const string& name, uint32_t max_samples) {
157 MultiThreadingLock lock(*mutex_);
158 return (setMaxSampleCountInternal(name, max_samples));
159}
160
161 bool
162StatsMgr::setMaxSampleCountInternal(const string& name,
163 uint32_t max_samples) {
164 ObservationPtr obs = getObservationInternal(name);
165 if (obs) {
166 obs->setMaxSampleCount(max_samples);
167 return (true);
168 }
169 return (false);
170}
171
172 void
173 StatsMgr::setMaxSampleAgeAll(const StatsDuration& duration) {
174 MultiThreadingLock lock(*mutex_);
175 setMaxSampleAgeAllInternal(duration);
176}
177
178 void
179StatsMgr::setMaxSampleAgeAllInternal(const StatsDuration& duration) {
180 global_->setMaxSampleAgeAll(duration);
181}
182
183 void
184 StatsMgr::setMaxSampleCountAll(uint32_t max_samples) {
185 MultiThreadingLock lock(*mutex_);
186 setMaxSampleCountAllInternal(max_samples);
187}
188
189 void
190StatsMgr::setMaxSampleCountAllInternal(uint32_t max_samples) {
191 global_->setMaxSampleCountAll(max_samples);
192}
193
194 void
195 StatsMgr::setMaxSampleAgeDefault(const StatsDuration& duration) {
196 MultiThreadingLock lock(*mutex_);
197 setMaxSampleAgeDefaultInternal(duration);
198}
199
200 void
201StatsMgr::setMaxSampleAgeDefaultInternal(const StatsDuration& duration) {
202 Observation::setMaxSampleAgeDefault(duration);
203}
204
205 void
206 StatsMgr::setMaxSampleCountDefault(uint32_t max_samples) {
207 MultiThreadingLock lock(*mutex_);
208 setMaxSampleCountDefaultInternal(max_samples);
209}
210
211 void
212StatsMgr::setMaxSampleCountDefaultInternal(uint32_t max_samples) {
213 Observation::setMaxSampleCountDefault(max_samples);
214}
215
216 const StatsDuration&
217 StatsMgr::getMaxSampleAgeDefault() const {
218 MultiThreadingLock lock(*mutex_);
219 return (getMaxSampleAgeDefaultInternal());
220}
221
222 const StatsDuration&
223StatsMgr::getMaxSampleAgeDefaultInternal() const {
224 return (Observation::getMaxSampleAgeDefault());
225}
226
227uint32_t
228 StatsMgr::getMaxSampleCountDefault() const {
229 MultiThreadingLock lock(*mutex_);
230 return (getMaxSampleCountDefaultInternal());
231}
232
233uint32_t
234StatsMgr::getMaxSampleCountDefaultInternal() const {
235 return (Observation::getMaxSampleCountDefault());
236}
237
238 bool
239 StatsMgr::reset(const string& name) {
240 MultiThreadingLock lock(*mutex_);
241 return (resetInternal(name));
242}
243
244 bool
245StatsMgr::resetInternal(const string& name) {
246 ObservationPtr obs = getObservationInternal(name);
247 if (obs) {
248 obs->reset();
249 return (true);
250 }
251 return (false);
252}
253
254 bool
255 StatsMgr::del(const string& name) {
256 MultiThreadingLock lock(*mutex_);
257 return (delInternal(name));
258}
259
260 bool
261StatsMgr::delInternal(const string& name) {
262 return (global_->del(name));
263}
264
265 void
266 StatsMgr::removeAll() {
267 MultiThreadingLock lock(*mutex_);
268 removeAllInternal();
269}
270
271 void
272StatsMgr::removeAllInternal() {
273 global_->clear();
274}
275
276 ConstElementPtr
277 StatsMgr::get(const string& name) const {
278 MultiThreadingLock lock(*mutex_);
279 return (getInternal(name));
280}
281
282 ConstElementPtr
283StatsMgr::getInternal(const string& name) const {
284 ElementPtr map = Element::createMap(); // a map
285 ObservationPtr obs = getObservationInternal(name);
286 if (obs) {
287 map->set(name, obs->getJSON()); // that contains observations
288 }
289 return (map);
290}
291
292 ConstElementPtr
293 StatsMgr::getAll() const {
294 MultiThreadingLock lock(*mutex_);
295 return (getAllInternal());
296}
297
298 ConstElementPtr
299StatsMgr::getAllInternal() const {
300 return (global_->getAll());
301}
302
303 void
304 StatsMgr::resetAll() {
305 MultiThreadingLock lock(*mutex_);
306 resetAllInternal();
307}
308
309 void
310StatsMgr::resetAllInternal() {
311 global_->resetAll();
312}
313
314 size_t
315 StatsMgr::getSize(const string& name) const {
316 MultiThreadingLock lock(*mutex_);
317 return (getSizeInternal(name));
318}
319
320 size_t
321StatsMgr::getSizeInternal(const string& name) const {
322 ObservationPtr obs = getObservationInternal(name);
323 if (obs) {
324 return (obs->getSize());
325 }
326 return (0);
327}
328
329 size_t
330 StatsMgr::count() const {
331 MultiThreadingLock lock(*mutex_);
332 return (countInternal());
333}
334
335 size_t
336StatsMgr::countInternal() const {
337 return (global_->size());
338}
339
340 ConstElementPtr
341 StatsMgr::statisticSetMaxSampleAgeHandler(const string& /*name*/,
342 const ConstElementPtr& params) {
343 string name, error;
344 StatsDuration duration;
345 if (!StatsMgr::getStatName(params, name, error)) {
346 return (createAnswer(CONTROL_RESULT_ERROR, error));
347 }
348 if (!StatsMgr::getStatDuration(params, duration, error)) {
349 return (createAnswer(CONTROL_RESULT_ERROR, error));
350 }
351 if (StatsMgr::instance().setMaxSampleAge(name, duration)) {
352 return (createAnswer(CONTROL_RESULT_SUCCESS,
353 "Statistic '" + name + "' duration limit is set."));
354 } else {
355 return (createAnswer(CONTROL_RESULT_ERROR,
356 "No '" + name + "' statistic found"));
357 }
358}
359
360 ConstElementPtr
361 StatsMgr::statisticSetMaxSampleCountHandler(const string& /*name*/,
362 const ConstElementPtr& params) {
363 string name, error;
364 uint32_t max_samples;
365 if (!StatsMgr::getStatName(params, name, error)) {
366 return (createAnswer(CONTROL_RESULT_ERROR, error));
367 }
368 if (!StatsMgr::getStatMaxSamples(params, max_samples, error)) {
369 return (createAnswer(CONTROL_RESULT_ERROR, error));
370 }
371 if (StatsMgr::instance().setMaxSampleCount(name, max_samples)) {
372 return (createAnswer(CONTROL_RESULT_SUCCESS,
373 "Statistic '" + name + "' count limit is set."));
374 } else {
375 return (createAnswer(CONTROL_RESULT_ERROR,
376 "No '" + name + "' statistic found"));
377 }
378}
379
380 ConstElementPtr
381 StatsMgr::statisticGetHandler(const string& /*name*/,
382 const ConstElementPtr& params) {
383 string name, error;
384 if (!StatsMgr::getStatName(params, name, error)) {
385 return (createAnswer(CONTROL_RESULT_ERROR, error));
386 }
387 return (createAnswer(CONTROL_RESULT_SUCCESS,
388 StatsMgr::instance().get(name)));
389}
390
391 ConstElementPtr
392 StatsMgr::statisticResetHandler(const string& /*name*/,
393 const ConstElementPtr& params) {
394 string name, error;
395 if (!StatsMgr::getStatName(params, name, error)) {
396 return (createAnswer(CONTROL_RESULT_ERROR, error));
397 }
398 if (StatsMgr::instance().reset(name)) {
399 return (createAnswer(CONTROL_RESULT_SUCCESS,
400 "Statistic '" + name + "' reset."));
401 } else {
402 return (createAnswer(CONTROL_RESULT_ERROR,
403 "No '" + name + "' statistic found"));
404 }
405}
406
407 ConstElementPtr
408 StatsMgr::statisticRemoveHandler(const string& /*name*/,
409 const ConstElementPtr& params) {
410 string name, error;
411 if (!StatsMgr::getStatName(params, name, error)) {
412 return (createAnswer(CONTROL_RESULT_ERROR, error));
413 }
414 if (StatsMgr::instance().del(name)) {
415 return (createAnswer(CONTROL_RESULT_SUCCESS,
416 "Statistic '" + name + "' removed."));
417 } else {
418 return (createAnswer(CONTROL_RESULT_ERROR,
419 "No '" + name + "' statistic found"));
420 }
421
422}
423
424 ConstElementPtr
425 StatsMgr::statisticRemoveAllHandler(const string& /*name*/,
426 const ConstElementPtr& /*params*/) {
427 StatsMgr::instance().removeAll();
428 return (createAnswer(CONTROL_RESULT_SUCCESS,
429 "Warning: statistic-remove-all command is deprecated."
430 " All statistics removed."));
431}
432
433 ConstElementPtr
434 StatsMgr::statisticGetAllHandler(const string& /*name*/,
435 const ConstElementPtr& /*params*/) {
436 ConstElementPtr all_stats = StatsMgr::instance().getAll();
437 return (createAnswer(CONTROL_RESULT_SUCCESS, all_stats));
438}
439
440 ConstElementPtr
441 StatsMgr::statisticResetAllHandler(const string& /*name*/,
442 const ConstElementPtr& /*params*/) {
443 StatsMgr::instance().resetAll();
444 return (createAnswer(CONTROL_RESULT_SUCCESS,
445 "All statistics reset to neutral values."));
446}
447
448 ConstElementPtr
449 StatsMgr::statisticSetMaxSampleAgeAllHandler(const ConstElementPtr& params) {
450 string error;
451 StatsDuration duration;
452 if (!StatsMgr::getStatDuration(params, duration, error)) {
453 return (createAnswer(CONTROL_RESULT_ERROR, error));
454 }
455 MultiThreadingLock lock(*mutex_);
456 StatsMgr::instance().setMaxSampleCountDefaultInternal(0);
457 StatsMgr::instance().setMaxSampleAgeDefaultInternal(duration);
458 StatsMgr::instance().setMaxSampleAgeAllInternal(duration);
459 return (createAnswer(CONTROL_RESULT_SUCCESS,
460 "All statistics duration limit are set."));
461}
462
463 ConstElementPtr
464 StatsMgr::statisticSetMaxSampleCountAllHandler(const ConstElementPtr& params) {
465 string error;
466 uint32_t max_samples;
467 if (!StatsMgr::getStatMaxSamples(params, max_samples, error)) {
468 return (createAnswer(CONTROL_RESULT_ERROR, error));
469 }
470 if (max_samples == 0) {
471 error = "'max-samples' parameter must not be zero";
472 return (createAnswer(CONTROL_RESULT_ERROR, error));
473 }
474 MultiThreadingLock lock(*mutex_);
475 StatsMgr::instance().setMaxSampleCountDefaultInternal(max_samples);
476 StatsMgr::instance().setMaxSampleCountAllInternal(max_samples);
477 return (createAnswer(CONTROL_RESULT_SUCCESS,
478 "All statistics count limit are set."));
479}
480
481 bool
482StatsMgr::getStatName(const ConstElementPtr& params,
483 string& name,
484 string& reason) {
485 if (!params) {
486 reason = "Missing mandatory 'name' parameter.";
487 return (false);
488 }
489 ConstElementPtr stat_name = params->get("name");
490 if (!stat_name) {
491 reason = "Missing mandatory 'name' parameter.";
492 return (false);
493 }
494 if (stat_name->getType() != Element::string) {
495 reason = "'name' parameter expected to be a string.";
496 return (false);
497 }
498 name = stat_name->stringValue();
499 return (true);
500}
501
502 bool
503StatsMgr::getStatDuration(const ConstElementPtr& params,
504 StatsDuration& duration,
505 string& reason) {
506 if (!params) {
507 reason = "Missing mandatory 'duration' parameter.";
508 return (false);
509 }
510 ConstElementPtr stat_duration = params->get("duration");
511 if (!stat_duration) {
512 reason = "Missing mandatory 'duration' parameter.";
513 return (false);
514 }
515 duration = std::chrono::seconds(stat_duration->intValue());
516 return (true);
517}
518
519 bool
520StatsMgr::getStatMaxSamples(const ConstElementPtr& params,
521 uint32_t& max_samples,
522 string& reason) {
523 if (!params) {
524 reason = "Missing mandatory 'max-samples' parameter.";
525 return (false);
526 }
527 ConstElementPtr stat_max_samples = params->get("max-samples");
528 if (!stat_max_samples) {
529 reason = "Missing mandatory 'max-samples' parameter.";
530 return (false);
531 }
532 if (stat_max_samples->getType() != Element::integer) {
533 reason = "'max-samples' parameter expected to be an integer.";
534 return (false);
535 }
536 max_samples = stat_max_samples->intValue();
537 return (true);
538}
539
540} // end of namespace stats
541} // end of namespace isc
bigints.h
Element::integer
@ integer
Definition data.h:140
Element::string
@ string
Definition data.h:144
Element::createMap
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
Definition data.cc:304
isc::stats::Observation::getMaxSampleAgeDefault
static const StatsDuration & getMaxSampleAgeDefault()
Get default maximum age of samples.
Definition observation.cc:393
isc::stats::Observation::getMaxSampleCountDefault
static uint32_t getMaxSampleCountDefault()
Get default maximum count of samples.
Definition observation.cc:397
isc::stats::Observation::setMaxSampleCountDefault
static void setMaxSampleCountDefault(uint32_t max_samples)
Determines default maximum count of samples.
Definition observation.cc:379
isc::stats::Observation::setMaxSampleAgeDefault
static void setMaxSampleAgeDefault(const StatsDuration &duration)
Determines default maximum age of samples.
Definition observation.cc:374
isc::stats::StatsMgr
Statistics Manager class.
Definition lib/stats/stats_mgr.h:65
isc::stats::StatsMgr::getObservation
ObservationPtr getObservation(const std::string &name) const
Returns an observation.
Definition lib/stats/stats_mgr.cc:100
isc::stats::StatsMgr::getObservationInternal
ObservationPtr getObservationInternal(const std::string &name) const
Returns an observation in a thread safe context.
Definition lib/stats/stats_mgr.cc:106
isc::stats::StatsMgr::instance
static StatsMgr & instance()
Statistics Manager accessor method.
Definition lib/stats/stats_mgr.cc:30
isc::stats::StatsMgr::addObservationInternal
void addObservationInternal(const ObservationPtr &stat)
Adds a new observation in a thread safe context.
Definition lib/stats/stats_mgr.cc:119
isc::stats::StatsMgr::addValueInternal
void addValueInternal(const std::string &name, DataType value)
Adds specified value to a given statistic (internal version).
Definition lib/stats/stats_mgr.h:531
isc::stats::StatsMgr::addObservation
void addObservation(const ObservationPtr &stat)
Adds a new observation.
Definition lib/stats/stats_mgr.cc:113
isc::stats::StatsMgr::setValueInternal
void setValueInternal(const std::string &name, DataType value)
Sets a given statistic to specified value (internal version).
Definition lib/stats/stats_mgr.h:507
command_interpreter.h
This file contains several functions and constants that are used for handling commands and responses ...
data.h
exceptions.h
isc::stats::StatsMgr::statisticSetMaxSampleCountAllHandler
isc::data::ConstElementPtr statisticSetMaxSampleCountAllHandler(const isc::data::ConstElementPtr &params)
Handles statistic-sample-count-set-all command.
Definition lib/stats/stats_mgr.cc:464
isc::stats::StatsMgr::statisticResetHandler
static isc::data::ConstElementPtr statisticResetHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-reset command.
Definition lib/stats/stats_mgr.cc:392
isc::stats::StatsMgr::statisticGetAllHandler
static isc::data::ConstElementPtr statisticGetAllHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-get-all command.
Definition lib/stats/stats_mgr.cc:434
isc::stats::StatsMgr::statisticRemoveHandler
static isc::data::ConstElementPtr statisticRemoveHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-remove command.
Definition lib/stats/stats_mgr.cc:408
isc::stats::StatsMgr::statisticGetHandler
static isc::data::ConstElementPtr statisticGetHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-get command.
Definition lib/stats/stats_mgr.cc:381
isc::stats::StatsMgr::statisticSetMaxSampleAgeAllHandler
isc::data::ConstElementPtr statisticSetMaxSampleAgeAllHandler(const isc::data::ConstElementPtr &params)
Handles statistic-sample-age-set-all command.
Definition lib/stats/stats_mgr.cc:449
isc::stats::StatsMgr::statisticResetAllHandler
static isc::data::ConstElementPtr statisticResetAllHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-reset-all command.
Definition lib/stats/stats_mgr.cc:441
isc::stats::StatsMgr::statisticSetMaxSampleAgeHandler
static isc::data::ConstElementPtr statisticSetMaxSampleAgeHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-sample-age-set command.
Definition lib/stats/stats_mgr.cc:341
isc::stats::StatsMgr::statisticRemoveAllHandler
static isc::data::ConstElementPtr statisticRemoveAllHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-remove-all command.
Definition lib/stats/stats_mgr.cc:425
isc::stats::StatsMgr::statisticSetMaxSampleCountHandler
static isc::data::ConstElementPtr statisticSetMaxSampleCountHandler(const std::string &name, const isc::data::ConstElementPtr &params)
Handles statistic-sample-count-set command.
Definition lib/stats/stats_mgr.cc:361
isc::stats::StatsMgr::reset
bool reset(const std::string &name)
Resets specified statistic.
Definition lib/stats/stats_mgr.cc:239
isc::stats::StatsMgr::removeAll
void removeAll()
Removes all collected statistics.
Definition lib/stats/stats_mgr.cc:266
isc::stats::StatsMgr::resetAll
void resetAll()
Resets all collected statistics back to zero.
Definition lib/stats/stats_mgr.cc:304
isc::stats::StatsMgr::del
bool del(const std::string &name)
Removes specified statistic.
Definition lib/stats/stats_mgr.cc:255
isc::stats::StatsMgr::count
size_t count() const
Returns number of available statistics.
Definition lib/stats/stats_mgr.cc:330
isc::stats::StatsMgr::getAll
isc::data::ConstElementPtr getAll() const
Returns all statistics as a JSON structure.
Definition lib/stats/stats_mgr.cc:293
isc::stats::StatsMgr::getSize
size_t getSize(const std::string &name) const
Returns size of specified statistic.
Definition lib/stats/stats_mgr.cc:315
isc::stats::StatsMgr::get
isc::data::ConstElementPtr get(const std::string &name) const
Returns a single statistic as a JSON structure.
Definition lib/stats/stats_mgr.cc:277
isc::stats::StatsMgr::setMaxSampleCountDefault
void setMaxSampleCountDefault(uint32_t max_samples)
Set default count limit.
Definition lib/stats/stats_mgr.cc:206
isc::stats::StatsMgr::setMaxSampleCount
bool setMaxSampleCount(const std::string &name, uint32_t max_samples)
Determines how many samples of a given statistic should be kept.
Definition lib/stats/stats_mgr.cc:156
isc::stats::StatsMgr::getMaxSampleCountDefault
uint32_t getMaxSampleCountDefault() const
Get default count limit.
Definition lib/stats/stats_mgr.cc:228
isc::stats::StatsMgr::setValue
void setValue(const std::string &name, const int64_t value)
Records absolute integer observation.
Definition lib/stats/stats_mgr.cc:40
isc::stats::StatsMgr::setMaxSampleAge
bool setMaxSampleAge(const std::string &name, const StatsDuration &duration)
Determines maximum age of samples.
Definition lib/stats/stats_mgr.cc:139
isc::stats::StatsMgr::getMaxSampleAgeDefault
const StatsDuration & getMaxSampleAgeDefault() const
Get default duration limit.
Definition lib/stats/stats_mgr.cc:217
isc::stats::StatsMgr::setMaxSampleAgeAll
void setMaxSampleAgeAll(const StatsDuration &duration)
Set duration limit for all collected statistics.
Definition lib/stats/stats_mgr.cc:173
isc::stats::StatsMgr::setMaxSampleCountAll
void setMaxSampleCountAll(uint32_t max_samples)
Set count limit for all collected statistics.
Definition lib/stats/stats_mgr.cc:184
isc::stats::StatsMgr::addValue
void addValue(const std::string &name, const int64_t value)
Records incremental integer observation.
Definition lib/stats/stats_mgr.cc:70
isc::stats::StatsMgr::setMaxSampleAgeDefault
void setMaxSampleAgeDefault(const StatsDuration &duration)
Set default duration limit.
Definition lib/stats/stats_mgr.cc:195
stats_mgr.h
multi_threading_mgr.h
isc::config
Definition command_interpreter.cc:23
isc::config::CONTROL_RESULT_ERROR
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
Definition command_interpreter.h:45
isc::config::createAnswer
ConstElementPtr createAnswer()
Creates a standard config/command level success answer message (i.e.
Definition command_interpreter.cc:54
isc::config::CONTROL_RESULT_SUCCESS
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
Definition command_interpreter.h:42
isc::data
Definition base_stamped_element.cc:12
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
isc::stats
Definition context.cc:18
isc::stats::ObservationPtr
boost::shared_ptr< Observation > ObservationPtr
Observation pointer.
Definition observation.h:479
isc::stats::StatsDuration
std::chrono::system_clock::duration StatsDuration
Defines duration type.
Definition observation.h:43
isc::util
Definition time_utils.cc:43
isc::util::int128_t
boost::multiprecision::checked_int128_t int128_t
Definition bigints.h:19
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
isc::stats::StatContext
Statistics context.
Definition context.h:31
isc::util::MultiThreadingLock
RAII lock object to protect the code in the same scope with a mutex.
Definition multi_threading_mgr.h:349