The dashboard could say what the cluster was made of and not who was spending it. Usage was per key, which is the right unit for revoking something and the wrong one for the question actually being asked: one person holds a laptop key, a CI key and a notebook key, and adding three rows up by eye is a chore that gets skipped. Per person now, joined through the keys they own, and per model — counted by the model that answered rather than the one requested, since those differ whenever a fallback serves and what actually ran is the question. Headline figures are stat tiles with a sparkline: a single current value is a number, and plotting one is how a chart ends up with a single bar in it. The sparkline says only rising, falling or flat, which is the one thing the number cannot. Ranked horizontal bars, because the labels are email addresses and model names and the label is the point — the question is which person, not what shape the distribution has. Rotated or truncated axis labels say the chart matters more than reading it. Trimmed where drawn and complete on hover, so the plot keeps its geometry and a reader can still find out whose row it is. The palette is validated rather than chosen: every adjacent pair clears the colour-vision separation threshold, and the dark values are the same hues re-stepped for the dark surface instead of an automatic flip. Run through a validator, because that is the only way anyone can honestly claim a palette is colourblind-safe. Which turned up a bug in the existing chart code. cssVar is an allowlist of four names that silently returns --accent for anything else, and callers wrap it in var() themselves — so every new series would have rendered in one colour with accent-coloured text. Caught by a test written from the rule that chart text wears text tokens, never the series colour. A key with no owner is labelled "operator-issued keys" rather than unknown: it predates accounts and is doing its job, and "unknown" would imply something is wrong. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
28967edab3
commit
eb9e9b348c
9 files changed
+667
-1
No files matched your search
@@ -69,6 +69,12 @@ var funcs = template.FuncMap{
|
||||
},
|
||||
// Spend is stored in micro-units so accumulation is exact; it is shown in
|
||||
// whole units because that is the number an operator set a budget in.
|
||||
// compact renders a large count the way someone says it aloud: 1.2k rather
|
||||
// than 1247. Exactness is available in the tooltip and the table; a column
|
||||
// of seven-digit numbers is harder to compare than one of three.
|
||||
"compact": func(v int64) string {
|
||||
return compact(float64(v))
|
||||
},
|
||||
"units": func(micros int64) string {
|
||||
return fmt.Sprintf("%.2f", float64(micros)/1e6)
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user