Count flows rather than nodes in the health report

is keyed by node id, so a four-node flow reported four flows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LF61rxW1FG5YCD2J9YqjY
This commit is contained in:
2026-08-16 11:15:49 +02:00
co-authored by Claude Fable 5
parent 42075a6dae
commit 85abf58337
+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 []
)