Show usage over time, per organization, team, project and person
CI / test (push) Has been cancelled

Usage could be read as a total — per key, per user, per model, per group —
and the cluster's own charts covered the fleet's hardware. What nobody could
see was when a group used it. "Research doubled its traffic three weeks ago"
is not a question a column of totals can be asked, and it is the question
somebody asks before a quota conversation.

/admin/usage draws requests, tokens and spend over a chosen window, grouped
by any level of the tenancy tree or by person. Person is not a level of that
tree — one person holds keys in several projects — so the grouping is its
own type rather than store.Scope with a fourth value nothing else could use.

Three things learned from the charts already here. Buckets are gap-filled
per group, because a line drawn straight across an absence claims traffic
that did not happen, and because the chart sums its tail by timestamp and
can only do that if every series shares a clock. Series are ranked by total
rather than by peak — a counter's question is "who used the most", and
ranking by peak would colour the team that made one burst over the team that
ran steadily all week. And the spend chart is replaced by a sentence when no
model has a price, rather than drawn flat along the bottom.

The bucket query groups by ordinal and was planned against the cluster's
PostgreSQL before being believed, with a test alongside the others that run
there: three reports have shipped working on SQLite and failing on it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5 committed 2026-09-28 08:11:31 +02:00
1 parent f80eef9fa6
commit 07809490e3
15 files changed
+963 -4

No files matched your search

+21
View File
@@ -296,3 +296,24 @@ tr.editing form { margin: .4rem 0; }
.legend i { width: 10px; height: 2px; border-radius: 1px; display: inline-block; }
.legend b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.chart-title { font-size: .9rem; font-weight: 600; margin: 0 0 .3rem; }
/* The filter row above a report's charts.
One row, above the charts rather than beside them: the reader chooses what
they are looking at before they look, and a control column on the right is
found after the question has already been answered wrongly. Links rather
than a form, so the view is in the URL and can be shared. */
.filters { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
margin: 0 0 1rem; }
.filter-label { color: var(--muted); font-size: .78rem; text-transform: uppercase;
letter-spacing: .04em; margin-right: .2rem; }
.filter-label + .chip { margin-right: 0; }
.filters .filter-label:not(:first-child) { margin-left: 1rem; }
.chip { font-size: .85rem; text-decoration: none; color: var(--fg);
background: var(--card); border: 1px solid var(--line);
border-radius: 999px; padding: .25rem .7rem; }
.chip:hover { border-color: var(--accent); }
/* The selected one is filled, not merely outlined: an outline reads as
available rather than as chosen, and with four of them side by side the
difference has to survive a glance. */
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--bg);
font-weight: 600; }