Skip to content

Global stats: rankings, daily token chart and time ranges - #150

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

skyfallwastaken merged 1 commit into
neofrom
global-stats

Conversation

@skyfallwastaken

Copy link
Copy Markdown
Member

Global stats was one totals row and a table of raw model ids. It now works like OpenRouter's rankings.

  • Time range: 24 hours, 7 days (the default), 30 days, or all time, kept in the URL (/global?range=month).
  • Headline numbers: requests, tokens and active users for the range.
  • Tokens per day: a stacked bar chart over the last 30 days, split by the top 8 models plus "Other". Hovering a day shows a breakdown, and a legend is always shown. It uses the validated 8-hue categorical palette, with separate light and dark steps.
  • Top models: a leaderboard ranked by tokens, showing the catalog name, the id, share of tokens and requests. Routing variants (:nitro, :floor) count towards their base model. Only listed models link to /models/…, so no more 404s.
  • Top authors: share of tokens by model author (openai, google, moonshotai, …).

Each range is one set of ClickHouse aggregates, cached for 60 seconds like the old global stats. globalStats / modelStats are replaced by globalOverview(range).

Screenshots

The demo ClickHouse was seeded with 30 days of synthetic traffic from 140 fake accounts, so the charts have something to show.

Before (neo) After (7 days, hovering a day)
before after
Dark, 30 days Mobile
dark mobile

Testing

  • read-model.test.ts (real ClickHouse) checks:
    • per-range totals and active users;
    • variants folding into the base model;
    • the author fallback for non-OpenRouter ids;
    • chart series order;
    • 30 zero-filled UTC days.
  • bun run typecheck, bun run check: 0 errors. bun test: 0 fail.

🤖 Generated with Claude Code

@skyfallwastaken
skyfallwastaken merged commit b987e8d into neo Sep 26, 2026
3 checks passed
@skyfallwastaken
skyfallwastaken deleted the global-stats branch September 26, 2026 19:40
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