confd: refactor dhcp server counters

Counters should follow the format from ieee802-ethernet-interface
model, which use:

 - in/out for Rx/Tx
 - plural from

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-01-31 13:56:40 +01:00
parent 340330b75b
commit 95cfcaa2fe
3 changed files with 55 additions and 66 deletions
+8 -12
View File
@@ -70,18 +70,14 @@ def statistics():
}
return {
"sent": {
"offer-count": metrics["dhcp_offer"],
"ack-count": metrics["dhcp_ack"],
"nak-count": metrics["dhcp_nak"]
},
"received": {
"decline-count": metrics["dhcp_decline"],
"discover-count": metrics["dhcp_discover"],
"request-count": metrics["dhcp_request"],
"release-count": metrics["dhcp_release"],
"inform-count": metrics["dhcp_inform"]
}
"out-offers": metrics["dhcp_offer"],
"out-acks": metrics["dhcp_ack"],
"out-naks": metrics["dhcp_nak"],
"in-declines": metrics["dhcp_decline"],
"in-discovers": metrics["dhcp_discover"],
"in-requests": metrics["dhcp_request"],
"in-releases": metrics["dhcp_release"],
"in-informs": metrics["dhcp_inform"]
}