diff --git a/docs/interface/index.md b/docs/interface/index.md index 8c25987..32ae071 100644 --- a/docs/interface/index.md +++ b/docs/interface/index.md @@ -57,6 +57,8 @@ Always answers, degraded or not. The tiles cover: - **Flows** — total, running, paused, quarantined, and how many cannot run because their graph does not validate - **Nodes** — how many failed to load +- **Runs running** — batch runs in flight right now, and how many are + waiting. Only on an installation that has run something - **Queue** — depth, and how old the oldest pending item is - **Loop lag** — whether the engine's event loop is keeping up diff --git a/frontend/src/components/Health/HealthOverview.tsx b/frontend/src/components/Health/HealthOverview.tsx index 7339fc6..6a4826d 100644 --- a/frontend/src/components/Health/HealthOverview.tsx +++ b/frontend/src/components/Health/HealthOverview.tsx @@ -5,6 +5,7 @@ import type { FlowRollup, HistoryPoint } from "@/client" import { type Range, RangePicker } from "@/components/Common/RangePicker" import { Sparkline } from "@/components/Common/Sparkline" import { PANEL_SECTION } from "@/components/Flow/SidePanel" +import { runOverviewQueryOptions } from "@/components/Runs/queries" import { Badge } from "@/components/ui/badge" import { dur, si } from "@/lib/utils" import { @@ -82,10 +83,17 @@ export function HealthOverview({ const { data: flows } = useQuery(flowRollupsQueryOptions(range)) // Shares the list below's cache entry, for the one tile that dates them. const { data: failures } = useQuery(failuresQueryOptions(range)) + // Shares the Runs screen's cache entry, which already counts by status in + // the database rather than over a page of rows. + const { data: runs } = useQuery(runOverviewQueryOptions()) const queue = (summary?.queue ?? {}) as Record const degraded = summary?.status === "degraded" const errors = (flows ?? []).reduce((total, row) => total + row.errors, 0) + // An installation nobody has run a batch flow on has no runs tile at all — + // the same "nothing has been run yet" the Runs screen itself goes by. + const running = (runs ?? []).reduce((total, row) => total + row.running, 0) + const queued = (runs ?? []).reduce((total, row) => total + row.queued, 0) return ( <> @@ -105,7 +113,9 @@ export function HealthOverview({

) : null} -
+
+ {runs?.length ? ( + + ) : null}