Skip to content

Commit

Permalink
Updated log line for IP Usgae metrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsagasthya authored and rbtr committed Aug 9, 2023
1 parent e9ddb87 commit e0d56a4
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 e0d56a4

Please sign in to comment.