2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[#1065] addressed review

This commit is contained in:
Razvan Becheriu
2020-07-27 18:35:31 +03:00
parent 1b53b51430
commit 5b0ae36d19

View File

@@ -1855,9 +1855,6 @@ LeaseCmdsImpl::lease4WipeHandler(CalloutHandle& handle) {
num = LeaseMgrFactory::instance().wipeLeases4(id);
ids << " " << id;
int64_t previous_reclaimed = StatsMgr::instance().getObservation(
StatsMgr::generateName("subnet", id, "reclaimed-leases"))->getInteger().first;
int64_t previous_declined = StatsMgr::instance().getObservation(
StatsMgr::generateName("subnet", id, "declined-addresses"))->getInteger().first;
@@ -1865,16 +1862,11 @@ LeaseCmdsImpl::lease4WipeHandler(CalloutHandle& handle) {
StatsMgr::generateName("subnet", id, "assigned-addresses"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", id, "reclaimed-leases"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", id, "declined-addresses"),
int64_t(0));
StatsMgr::instance().addValue("reclaimed-leases", -previous_reclaimed);
StatsMgr::instance().addValue("declined-addresses", -previous_declined);
} else {
// Wipe them all!
@@ -1890,17 +1882,11 @@ LeaseCmdsImpl::lease4WipeHandler(CalloutHandle& handle) {
StatsMgr::generateName("subnet", sub->getID(), "assigned-addresses"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", sub->getID(), "reclaimed-leases"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", sub->getID(), "declined-addresses"),
int64_t(0));
}
StatsMgr::instance().setValue("reclaimed-leases", int64_t(0));
StatsMgr::instance().setValue("declined-addresses", int64_t(0));
}
@@ -1944,9 +1930,6 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
num = LeaseMgrFactory::instance().wipeLeases6(id);
ids << " " << id;
int64_t previous_reclaimed = StatsMgr::instance().getObservation(
StatsMgr::generateName("subnet", id, "reclaimed-leases"))->getInteger().first;
int64_t previous_declined = StatsMgr::instance().getObservation(
StatsMgr::generateName("subnet", id, "declined-addresses"))->getInteger().first;
@@ -1958,16 +1941,10 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
StatsMgr::generateName("subnet", id, "assigned-pds"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", id, "reclaimed-leases"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", id, "declined-addresses"),
int64_t(0));
StatsMgr::instance().addValue("reclaimed-leases", -previous_reclaimed);
StatsMgr::instance().addValue("declined-addresses", -previous_declined);
} else {
// Wipe them all!
@@ -1987,17 +1964,11 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
StatsMgr::generateName("subnet", sub->getID(), "assigned-pds"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", sub->getID(), "reclaimed-leases"),
int64_t(0));
StatsMgr::instance().setValue(
StatsMgr::generateName("subnet", sub->getID(), "declined-addresses"),
int64_t(0));
}
StatsMgr::instance().setValue("reclaimed-leases", int64_t(0));
StatsMgr::instance().setValue("declined-addresses", int64_t(0));
}