usagetest

package
v0.30.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func Fixture() []usage.Event

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

func Run(t *testing.T, open Open)

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.

Types

type Open

type Open func(t *testing.T, events []usage.Event) usage.Reader

Open returns a Reader whose store holds exactly events, registering any teardown on t. Run calls it once and only reads from the result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL