From 01728b22b24baf3fb82cc51395f5364c73e1e1fb Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Fri, 14 Mar 2025 20:47:22 +0200 Subject: [PATCH] [#1336] addressed review comments --- src/lib/dhcpsrv/alloc_engine.cc | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index 8189f6fefb..6248f46634 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -1561,8 +1561,10 @@ AllocEngine::removeNonmatchingReservedLeases6(ClientContext6& ctx, if (pool) { StatsMgr::instance().addValue( StatsMgr::generateName("subnet", subnet->getID(), - StatsMgr::generateName(ctx.currentIA().type_ == Lease::TYPE_NA ? "pool" : "pd-pool", pool->getID(), - ctx.currentIA().type_ == Lease::TYPE_NA ? "assigned-nas" : "assigned-pds")), + StatsMgr::generateName(ctx.currentIA().type_ == Lease::TYPE_NA ? + "pool" : "pd-pool", pool->getID(), + ctx.currentIA().type_ == Lease::TYPE_NA ? + "assigned-nas" : "assigned-pds")), static_cast(-1)); } } @@ -1620,8 +1622,10 @@ AllocEngine::removeNonmatchingReservedNoHostLeases6(ClientContext6& ctx, if (pool) { StatsMgr::instance().addValue( StatsMgr::generateName("subnet", subnet->getID(), - StatsMgr::generateName(candidate->type_ == Lease::TYPE_NA ? "pool" : "pd-pool", pool->getID(), - candidate->type_ == Lease::TYPE_NA ? "assigned-nas" : "assigned-pds")), + StatsMgr::generateName(candidate->type_ == Lease::TYPE_NA ? + "pool" : "pd-pool", pool->getID(), + candidate->type_ == Lease::TYPE_NA ? + "assigned-nas" : "assigned-pds")), static_cast(-1)); } } @@ -1703,8 +1707,10 @@ AllocEngine::removeNonreservedLeases6(ClientContext6& ctx, if (pool) { StatsMgr::instance().addValue( StatsMgr::generateName("subnet", subnet->getID(), - StatsMgr::generateName(ctx.currentIA().type_ == Lease::TYPE_NA ? "pool" : "pd-pool", pool->getID(), - ctx.currentIA().type_ == Lease::TYPE_NA ? "assigned-nas" : "assigned-pds")), + StatsMgr::generateName(ctx.currentIA().type_ == Lease::TYPE_NA ? + "pool" : "pd-pool", pool->getID(), + ctx.currentIA().type_ == Lease::TYPE_NA ? + "assigned-nas" : "assigned-pds")), static_cast(-1)); } } @@ -2958,7 +2964,8 @@ AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease, if (pool) { StatsMgr::instance().addValue( StatsMgr::generateName("subnet", subnet->getID(), - StatsMgr::generateName(lease->type_ == Lease::TYPE_NA ? "pool" : "pd-pool", + StatsMgr::generateName(lease->type_ == Lease::TYPE_NA ? + "pool" : "pd-pool", pool->getID(), "reclaimed-leases")), static_cast(1)); } @@ -2980,7 +2987,8 @@ AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease, } else if (lease->type_ == Lease::TYPE_NA || lease->type_ == Lease::TYPE_PD) { StatsMgr::instance().addValue(StatsMgr::generateName("subnet", lease->subnet_id_, - lease->type_ == Lease::TYPE_NA ? "assigned-nas" : "assigned-pds"), + lease->type_ == Lease::TYPE_NA ? + "assigned-nas" : "assigned-pds"), static_cast(-1)); if (subnet) { @@ -2988,8 +2996,10 @@ AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease, if (pool) { StatsMgr::instance().addValue( StatsMgr::generateName("subnet", subnet->getID(), - StatsMgr::generateName(lease->type_ == Lease::TYPE_NA ? "pool" : "pd-pool", pool->getID(), - lease->type_ == Lease::TYPE_NA ? "assigned-nas" : "assigned-pds")), + StatsMgr::generateName(lease->type_ == Lease::TYPE_NA ? + "pool" : "pd-pool", pool->getID(), + lease->type_ == Lease::TYPE_NA ? + "assigned-nas" : "assigned-pds")), static_cast(-1)); } }