From 9634327b592886bc63c6aa72bc376f5cf5cc733f Mon Sep 17 00:00:00 2001 From: iris Date: Tue, 23 Jun 2026 00:21:11 +0200 Subject: [PATCH] docs(web-ui): document the 'all' stats window Follow-up to the stats 'all' time-range feature: the agent and hive stats endpoint docs enumerated the window options but predated 'all'. Add it to the /api/stats and /api/stats-hive window lists, and note that 'all' ranges from the earliest recorded turn with an adaptive bucket width. --- docs/web-ui/agent.md | 7 ++++--- docs/web-ui/dashboard.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/web-ui/agent.md b/docs/web-ui/agent.md index 3365a486..4ad53c60 100644 --- a/docs/web-ui/agent.md +++ b/docs/web-ui/agent.md @@ -328,8 +328,9 @@ shaped). flyout (`renderLooseEnds`). Returns pending questions the agent asked or owes, plus pending reminders. Also calls `reconcileAskBinds()` to wire inline answer forms to open `question_asked` events. -- `GET /api/stats?window=24h|7d|30d` — time-bucketed turn analytics - `Snapshot` consumed by the `/stats` page. +- `GET /api/stats?window=24h|7d|30d|all` — time-bucketed turn analytics + `Snapshot` consumed by the `/stats` page. `all` ranges from the + earliest recorded turn with an adaptive bucket width. - `GET /events/history` — replay buffer for the terminal. - `GET /screen` — VNC viewer page (minimal RFB-over-WebSocket renderer — deliberately thin, just enough to display the @@ -380,7 +381,7 @@ Bus events (new vocabulary on `/events/stream`): harness, linked from the per-agent page's `📊 stats →` and from each dashboard container row). Turn analytics, read-only, from `/state/hyperhive-turn-stats.sqlite`. `GET /api/stats?window= -24h|7d|30d` returns a time-bucketed `Snapshot`; the page renders +24h|7d|30d|all` returns a time-bucketed `Snapshot`; the page renders it with Chart.js (bundled into `stats.js` via esbuild — no CDN dependency). Charts: turns, duration (p50 · p95 · avg), context tokens, token cost per bucket, a **turns-by-model** stacked bar diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index c5e59c09..1a6b2362 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -1094,7 +1094,7 @@ that's a browser-level decision, not ours. `/dashboard/history` backfill. - `GET /api/reminders` — list pending reminders for the dashboard's queued-reminders panel. -- `GET /api/stats-hive?window=<1h|4h|24h|3d|7d|30d>` — hive-wide +- `GET /api/stats-hive?window=<1h|4h|24h|3d|7d|30d|all>` — hive-wide turn-stats rollup for the ST4TS tab. Aggregates every agent's `hyperhive-turn-stats.sqlite` read-only (skips missing / unreadable / zero-turn dbs); returns swarm totals, a busiest-first per-agent