Skip to content

Commit

Permalink
Updated log line for IP Usage metrics. (#1961)
Browse files Browse the repository at this point in the history
Added the pendingprogramming and pendingrelease count in the log line.
  • Loading branch information
rsagasthya authored and jpayne3506 committed Sep 11, 2023
1 parent e308e0a commit 456a06c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cns/restserver/ipusage.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ func (service *HTTPRestService) buildIPState() *ipState {
defer service.Unlock()

state := ipState{
allocatedIPs: 0,
assignedIPs: 0,
availableIPs: 0,
allocatedIPs: 0,
assignedIPs: 0,
availableIPs: 0,
programmingIPs: 0,
releasingIPs: 0,
}

//nolint:gocritic // This has to iterate over the IP Config state to get the counts.
Expand All @@ -45,6 +47,12 @@ func (service *HTTPRestService) buildIPState() *ipState {
}
}

logger.Printf("[IP Usage] allocated IPs: %d, assigned IPs: %d, available IPs: %d", state.allocatedIPs, state.assignedIPs, state.availableIPs)
logger.Printf("[IP Usage] Allocated IPs: %d, Assigned IPs: %d, Available IPs: %d, PendingProgramming IPs: %d, PendingRelease IPs: %d",
state.allocatedIPs,
state.assignedIPs,
state.availableIPs,
state.programmingIPs,
state.releasingIPs,
)
return &state
}

0 comments on commit 456a06c

Please sign in to comment.