Skip to content

Chart the selected range on Global stats - #152

Merged
skyfallwastaken merged 1 commit into
neofrom
global-chart-range
Sep 26, 2026
Merged

skyfallwastaken merged 1 commit into
neofrom
global-chart-range

Conversation

@skyfallwastaken

Copy link
Copy Markdown
Member

The Global stats chart always showed the last 30 days, whatever range was selected. It now follows the range picker:

Range Bars
24 hours 24 hourly bars
7 days 7 daily bars
30 days 30 daily bars
All time one bar per month, from the first month with usage

The top-8 series are picked from the selected range too, so "24 hours" colors the models that were busy today. The title, subtitle, edge labels and tooltip adapt: "Tokens per hour 路 Last 24 hours" with 26 Sep 2026, 17:00, and "Tokens per month 路 All time" with Aug 2026. The tooltip is now anchored to the hovered bar rather than assuming 30 bars.

Screenshots

Demo data: synthetic traffic in the local hcai_demo ClickHouse.

Before: 24 hours selected, still 30 days of bars

before

After

24 hours 7 days
day week
30 days All time (the demo data only spans two months)
month all

Testing

  • The existing global-usage test in read-model.test.ts now also checks:
    • 24 hourly bars ending at the current hour, with series limited to that window;
    • 30 daily bars;
    • monthly bars from the first month with usage to the current month, adding up to the all-time total.
  • bun run typecheck, bun run check: 0 errors. bun test: 303 pass, 0 fail.

馃 Generated with Claude Code

@skyfallwastaken
skyfallwastaken merged commit f15248a into neo Sep 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant