Documentation
¶
Overview ¶
Package usagetest is the conformance suite every usage.Reader backend runs: one fixed event fixture, one table of queries per Reader method, and the results every backend must return for them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Start = time.Date(2026, 1, 5, 10, 0, 0, 0, time.UTC)
Start is the first included fixture event; every timestamp is a fixed offset from it so no result depends on the wall clock.
Functions ¶
func Fixture ¶
Fixture returns the events every backend is loaded with. Durations are equal within a model (model-a 200ms, model-b 100ms) and every TTFT truncates to 40ms except r03's 41ms, so percentiles agree across backends on any row holding one model and one TTFT. Some averages are fractional on purpose (key-a: 166.7ms duration, 41.3ms TTFT) to pin truncation on every backend. r00 and r11 are log-only and sit outside the included span, so a backend that aggregates them shifts counts, from/to and buckets. r05 carries no relay key. Only r01/r02 (project-a) and r06/r11 (principal-a) carry attribution, for read-scope cases. r01/r02 were served from pool-a under acct-a in lane lane-a and r03 from pool-b under acct-b in lane-b; the rest carry no pool, account or lane. Of the log-only rows, r00 failed before any upstream (status 0) and r11 is a relay refusal (no_capacity) answered 429. Host hid-1 is renamed from host-old to host-new and its newest included event has no slug, so its label is host-new; hid-3 never has a slug and r09 has no host.
func Run ¶
Run loads Fixture through open and checks Events, Count, Summary (alone and against a previous window), TimeSeries (with the id labels both carry) and Facet against the expected results in this package's case tables.
func Window ¶
func Window() usage.EventQuery
Window is a filter spanning every fixture event, log-only ones included.