Count flows rather than nodes in the health report

is keyed by node id, so a four-node flow reported four flows.
This commit is contained in:
2026-08-16 11:15:49 +02:00
parent 52d1f32c88
commit 5f5ce5fc22
+3 -1
View File
@@ -69,7 +69,9 @@ async def health(request: Request, response: Response) -> dict[str, Any]:
redis_info["rtt_ms"] = round((time.perf_counter() - start) * 1000, 1)
if not connected:
problems.append("redis unreachable")
engine["flows"] = len(getattr(controller, "loaded", {}) or {})
# `loaded` is keyed by node id, so its length is a node count.
loaded = getattr(controller, "loaded", {}) or {}
engine["flows"] = len({entry.flow for entry in loaded.values()})
engine["nodes"] = len(
getattr(getattr(controller, "pipeline", None), "nodes", []) or []
)