2038. [func] djt
- Add additional stats counters for host reservation
- conflicts to global and subnet scope stats. The new global
- stat is called v4-reservation-conflicts and the subnet
- specific stat is called subnet[id].reservation-conflicts.
+ Added a new statistic to kea-dhcp4 that counts host
+ reservation conflicts. It is tracked at both the global
+ and subnet level as v4-reservation-conflicts and
+ subnet[id].v4-reservation-conflicts respectively.
(Gitlab #2419)
2037. [bug] razvan, marcin
| | | occurred across every subnet. When |
| | | a client sends a DHCP Discover and |
| | | is matched to a host reservation |
- | | | which is already leased out by |
- | | | another client, this counter is |
- | | | increased by 1. |
+ | | | which is already leased to another |
+ | | | client, this counter is increased |
+ | | | by 1. |
+----------------------------------------------+----------------+------------------------------------+
- | subnet[id].reservation-conflicts | integer | Number of host reservation |
+ | subnet[id].v4-reservation-conflicts | integer | Number of host reservation |
| | | allocation conflicts which have |
| | | occurred in a specific subnet. |
| | | When a client sends a DHCP |
| | | Discover and is matched to a host |
| | | reservation which is already |
- | | | leased out by another client, this |
+ | | | leased to another client, this |
| | | counter is increased by 1. |
+----------------------------------------------+----------------+------------------------------------+
ASSERT_NE(client_b_addr, in_pool_addr);
// Ensure stats are being recorded for HR conflicts
ObservationPtr subnet_conflicts = StatsMgr::instance().getObservation(
- "subnet[1].reservation-conflicts");
+ "subnet[1].v4-reservation-conflicts");
ASSERT_TRUE(subnet_conflicts);
ASSERT_EQ(1, subnet_conflicts->getInteger().first);
subnet_conflicts = StatsMgr::instance().getObservation("v4-reservation-conflicts");
ASSERT_NE(clientB.config_.lease_.addr_, in_pool_addr);
ASSERT_EQ(client_b_addr, clientB.config_.lease_.addr_);
// Ensure stats are being recorded for HR conflicts
- subnet_conflicts = StatsMgr::instance().getObservation("subnet[1].reservation-conflicts");
+ subnet_conflicts = StatsMgr::instance().getObservation(
+ "subnet[1].v4-reservation-conflicts");
ASSERT_TRUE(subnet_conflicts);
ASSERT_EQ(2, subnet_conflicts->getInteger().first);
subnet_conflicts = StatsMgr::instance().getObservation("v4-reservation-conflicts");
EXPECT_NE("10.0.0.123", resp->getYiaddr().toText());
// Ensure stats are being recorded for HR conflicts
ObservationPtr subnet_conflicts = StatsMgr::instance().getObservation(
- "subnet[10].reservation-conflicts");
+ "subnet[10].v4-reservation-conflicts");
ASSERT_TRUE(subnet_conflicts);
ASSERT_EQ(1, subnet_conflicts->getInteger().first);
subnet_conflicts = StatsMgr::instance().getObservation("v4-reservation-conflicts");
EXPECT_NE("192.0.2.28", resp1->getYiaddr().toText());
// Ensure stats are being recorded for HR conflicts
ObservationPtr subnet_conflicts = StatsMgr::instance().getObservation(
- "subnet[10].reservation-conflicts");
+ "subnet[10].v4-reservation-conflicts");
ASSERT_TRUE(subnet_conflicts);
ASSERT_EQ(1, subnet_conflicts->getInteger().first);
subnet_conflicts = StatsMgr::instance().getObservation("v4-reservation-conflicts");
StatsMgr::instance().addValue(StatsMgr::generateName(
"subnet",
ctx.conflicting_lease_->subnet_id_,
- "reservation-conflicts"),
+ "v4-reservation-conflicts"),
static_cast<int64_t>(1));
StatsMgr::instance().addValue("v4-reservation-conflicts",
static_cast<int64_t>(1));
if (!stats_mgr.getObservation(name)) {
stats_mgr.setValue(name, static_cast<int64_t>(0));
}
- name = StatsMgr::generateName("subnet", subnet_id, "reservation-conflicts");
+
+ name = StatsMgr::generateName("subnet", subnet_id, "v4-reservation-conflicts");
if (!stats_mgr.getObservation(name)) {
stats_mgr.setValue(name, static_cast<int64_t>(0));
}
" \"subnet[1].reclaimed-declined-addresses\": [ [ 0, \"2022-02-11 17:54:17.487595\" ] ],",
" \"subnet[1].reclaimed-leases\": [ [ 0, \"2022-02-11 17:54:17.487604\" ] ],",
" \"subnet[1].total-addresses\": [ [ 200, \"2022-02-11 17:54:17.487512\" ] ],",
- " \"subnet[1].reservation-conflicts\": [ [ 0, \"2022-02-11 17:54:17.487520\" ] ]",
+ " \"subnet[1].v4-reservation-conflicts\": [ [ 0, \"2022-02-11 17:54:17.487520\" ] ]",
" \"v4-allocation-fail\": [ [ 0, \"2022-02-11 17:54:17.455302\" ] ],",
" \"v4-allocation-fail-classes\": [ [ 0, \"2022-02-11 17:54:17.455306\" ] ],",
" \"v4-allocation-fail-no-pools\": [ [ 0, \"2022-02-11 17:54:17.455310\" ] ],",