Kea  2.1.7-git
d2_stats.cc
Go to the documentation of this file.
1 // Copyright (C) 2021 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 
8 
9 #include <config.h>
10 
11 #include <d2srv/d2_stats.h>
12 #include <stats/stats_mgr.h>
13 
14 using namespace std;
15 using namespace isc::stats;
16 
17 namespace isc {
18 namespace d2 {
19 
20 const list<string>
21 D2Stats::ncr = {
22  "ncr-received",
23  "ncr-invalid",
24  "ncr-error"
25 };
26 
27 const list<string>
28 D2Stats::update = {
29  "update-sent",
30  "update-signed",
31  "update-unsigned",
32  "update-success",
33  "update-timeout",
34  "update-error"
35 };
36 
37 const list<string>
38 D2Stats::key = {
39  "update-sent",
40  "update-success",
41  "update-timeout",
42  "update-error"
43 };
44 
45 void
46 D2Stats::init() {
48  stats_mgr.setMaxSampleCountDefault(0);
49  for (const auto& name : D2Stats::ncr) {
50  stats_mgr.setValue(name, static_cast<int64_t>(0));
51  }
52  for (const auto& name : D2Stats::update) {
53  stats_mgr.setValue(name, static_cast<int64_t>(0));
54  }
55 };
56 
57 } // namespace d2
58 } // namespace isc
void setMaxSampleCountDefault(uint32_t max_samples)
Set default count limit.
STL namespace.
static StatsMgr & instance()
Statistics Manager accessor method.
Statistics Manager class.
Defines the logger used by the top-level component of kea-lfc.
void setValue(const std::string &name, const int64_t value)
Records absolute integer observation.