From f653cacd1a31fb0f7e3e07239e2a9bf3acde9fc2 Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 2 Dec 2025 12:37:35 +0100 Subject: [PATCH] statd: populate service runtime statistic Populate operational runtime statistics for services. Signed-off-by: Richard Alpe --- src/statd/python/yanger/ietf_system.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/statd/python/yanger/ietf_system.py b/src/statd/python/yanger/ietf_system.py index 23e08d0f..ba7aa1b0 100644 --- a/src/statd/python/yanger/ietf_system.py +++ b/src/statd/python/yanger/ietf_system.py @@ -189,7 +189,12 @@ def add_services(out): "pid": d["pid"], "name": d["identity"], "status": d["status"], - "description": d["description"] + "description": d["description"], + "statistics": { + "memory-usage": str(d.get("memory", 0)), + "uptime": str(d.get("uptime", 0)), + "restart-count": int(d.get("restarts", 0)) + } } services.append(entry)