mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-05 08:25:16 +00:00
[#2797] add lease reuse statistics
v4 reuses leases both on fake allocation and on real allocation, while v6 only reuses leases on real allocation. This is a discrepancy that is also exposed in the statistics, and may seem confusing. However, this seems like the candidate for a new issue.
This commit is contained in:
@@ -136,7 +136,8 @@ std::set<std::string> dhcp4_statistics = {
|
||||
"v4-allocation-fail-subnet",
|
||||
"v4-allocation-fail-no-pools",
|
||||
"v4-allocation-fail-classes",
|
||||
"v4-reservation-conflicts"
|
||||
"v4-reservation-conflicts",
|
||||
"v4-lease-reuses",
|
||||
};
|
||||
|
||||
} // end of anonymous namespace
|
||||
@@ -2852,6 +2853,12 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
|
||||
.arg(query->getLabel())
|
||||
.arg(lease->addr_.toText())
|
||||
.arg(Lease::lifetimeToText(lease->valid_lft_));
|
||||
|
||||
// Increment the reuse statistics.
|
||||
StatsMgr::instance().addValue("v4-lease-reuses", int64_t(1));
|
||||
StatsMgr::instance().addValue(StatsMgr::generateName("subnet", lease->subnet_id_,
|
||||
"v4-lease-reuses"),
|
||||
int64_t(1));
|
||||
}
|
||||
|
||||
// IP Address Lease time (type 51)
|
||||
|
Reference in New Issue
Block a user