summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/cfg_subnets6.cc
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2020-04-04 18:53:50 +0200
committerFrancis Dupont <fdupont@isc.org>2020-04-23 23:23:18 +0200
commit3f43d49e1ce69b6ef09aed6ca4336c19d785bffd (patch)
treeeee722006472ddb5026c094f18d75f16196c783a /src/lib/dhcpsrv/cfg_subnets6.cc
parent[#1192] Fixed first entry (diff)
downloadkea-3f43d49e1ce69b6ef09aed6ca4336c19d785bffd.tar.xz
kea-3f43d49e1ce69b6ef09aed6ca4336c19d785bffd.zip
[#816] Added per subnet cumulative assigned stats
Diffstat (limited to 'src/lib/dhcpsrv/cfg_subnets6.cc')
-rw-r--r--src/lib/dhcpsrv/cfg_subnets6.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/dhcpsrv/cfg_subnets6.cc b/src/lib/dhcpsrv/cfg_subnets6.cc
index 852262c183..91769cc654 100644
--- a/src/lib/dhcpsrv/cfg_subnets6.cc
+++ b/src/lib/dhcpsrv/cfg_subnets6.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -395,12 +395,18 @@ CfgSubnets6::removeStatistics() {
stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
"assigned-nas"));
+ stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
+ "cumulative-assigned-nas"));
+
stats_mgr.del(StatsMgr::generateName("subnet", subnet_id, "total-pds"));
stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
"assigned-pds"));
stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
+ "cumulative-assigned-pds"));
+
+ stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
"declined-addresses"));
stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
@@ -430,6 +436,18 @@ CfgSubnets6::updateStatistics() {
"total-pds"),
static_cast<int64_t>
((*subnet6)->getPoolCapacity(Lease::TYPE_PD)));
+
+ const std::string& name_nas =
+ StatsMgr::generateName("subnet", subnet_id, "cumulative-assigned-nas");
+ if (!stats_mgr.getObservation(name_nas)) {
+ stats_mgr.setValue(name_nas, static_cast<int64_t>(0));
+ }
+
+ const std::string& name_pds =
+ StatsMgr::generateName("subnet", subnet_id, "cumulative-assigned-pds");
+ if (!stats_mgr.getObservation(name_pds)) {
+ stats_mgr.setValue(name_pds, static_cast<int64_t>(0));
+ }
}
// Only recount the stats if we have subnets.