Namespace Kuestenlogik.Bowire.Benchmarking
Classes
- BowireBenchmarkRequest
What to measure and how hard to push (#360).
- BowireBenchmarkRun
One completed benchmark run.
- BowireBenchmarkRunner
Drives a protocol plugin's invoke path in a loop and collects latencies (#360). Deliberately thin: it owns concurrency, warm-up and timing, and leaves the transport to IBowireProtocol — the same seam
bowire callandbowire testinvoke through, so a benchmark measures the request path the rest of the tool actually uses.
- BowireBenchmarkSample
#623 — one call of a run, where it fell in the run:
OffsetMsis when it completed, counted from the run's start.
- BowireBenchmarkSchedule
A benchmark that fires on a cron schedule (#232).
The schedule carries the whole request rather than pointing at a workbench envelope on purpose: envelopes live in the browser's localStorage, and a hosted service running in the server process cannot read those. Persisting what to call — and how hard — next to the cron expression is what lets a schedule survive a restart and run with no operator present, which is the point of the ticket.
- BowireBenchmarkScheduleEndpoints
The benchmark-schedule HTTP surface.
- BowireBenchmarkScheduleRun
One recorded execution of a scheduled benchmark (#232).
- BowireBenchmarkScheduleStore
On-disk store for benchmark schedules and their run history (#232), under
.bowire/benchmark-schedules/.Persistence is the restart-survival requirement: the hosted service holds no schedule state of its own, it re-reads this directory on boot. One JSON file per schedule, plus a sibling
<id>.runs.jsonholding the newest-first history, so a run appended by a firing never rewrites the schedule definition an operator may be editing.
- BowireBenchmarkScheduleThreshold
A threshold verdict recorded with a scheduled run.
- BowireBenchmarkSchedulingEndpointContribution
Mounts the schedule API for the workbench (#232).
- BowireBenchmarkSchedulingHostedService
Fires scheduled benchmarks (#232).
Holds no schedule state of its own: it re-reads the store on every tick, which is what makes a schedule survive a restart (the entry is on disk, not in memory) and also means an operator adding, pausing or deleting a schedule takes effect without a bounce.
A run is due when its next cron occurrence has passed since the last time this service looked. Comparing against the schedule's own last-run timestamp — rather than an in-memory timer — keeps a missed window (host asleep, deploy in progress) from silently swallowing the run, and keeps a restart from re-firing one that already happened.
- BowireBenchmarkSchedulingServiceContribution
Registers the scheduling backbone (#232). Discovered by Core's service contribution scan, so referencing the Benchmarking package is all a host has to do to get scheduled runs — and a host that doesn't reference it starts no scheduler at all.
- BowireBenchmarksRailContribution
Benchmarks rail contribution (#306 Phase G).
- BowireBenchmarkStats
Aggregate latency statistics over one benchmark run (#360).
Percentiles use nearest-rank —
ceil(p/100 × n) − 1into the sorted sample — which is the method the workbench's benchmark rail has always used (_percentileSortedin benchmarks.js). Matching it matters more than picking a "better" interpolation: an operator who sees p95 = 142 ms in the rail and then gates CI onp95 < 150must not get a different number from the CLI for the same sample.
- BowireBenchmarkThreshold
A latency / error / throughput budget a benchmark run must satisfy (#360) — k6's threshold concept, expressed the same way flow expectations are, so an operator learns one grammar.
Written as
metric operator budget:p95 < 200,error-rate < 0.01,throughput >= 50. Whitespace is optional and k6's ownp(95)spelling parses too, so a budget copied out of a k6 script keeps working.
- BowireBenchmarkTimeline
#623 — the shape of a run: its calls in time order, bucketed over its wall clock. A run that is uniformly flaky and one that collapsed halfway report the same error rate in total; here they look different.
The number of buckets follows the run's size, not a fixed interval: about the square root of the call count, at least 4 and at most 40, so a short run is not a row of empty slices and a long one is not a single smear. The rail's sparkline uses the same rule.
- BowireConnectionHoldRunner
#624 — opens connections and watches them instead of counting completions: N held at once for a duration, each reported by how long it stayed up, what arrived on it and how it ended. The loop differs in kind from BowireBenchmarkRunner's "call, time, repeat": it is "open, hold, observe", and it ends on a clock.
It measures what arrives at Bowire's end of the connection, which is enough to compare two configurations (#622) and no more: it does not judge an intermediary it cannot see.
- BowireHeldConnection
#624 — one connection of a hold, from open to end.
- BowireHoldRequest
#624 — what a connection-hold run opens and for how long.
- BowireHoldStats
#624 — what became of a hold's connections: the survival numbers a threshold reads, over every connection it opened.
- BowireK6Summary
Renders a run as k6-summary JSON (#234 shape, #360 thresholds).
The metric block mirrors what the workbench rail already exports (
http_req_duration/http_reqs/iterations/iteration_duration/http_req_failed/checks), so a dashboard that ingests a run exported from the UI ingests one written bybowire bench runwithout a second code path.Thresholds ride along the way k6 itself reports them: keyed by their source text inside the metric they constrain, each with an
okflag. That is what makes "downstream tooling agrees" true rather than aspirational — a CI dashboard reading k6 summaries finds Bowire's budgets exactly where it looks for k6's.
- BowireK6Target
#622 — one target of a multi-target run, for BuildTargets(IReadOnlyList<BowireK6Target>).
- BowireMetricContext
#621 — what one response offers an expression: its body, its headers (response metadata) and the rates of the run's price profile.
- BowireMetricExpression
#621 — an arithmetic expression over the values a response reports:
usage.prompt_tokens * rate.input + usage.completion_tokens * rate.output.Numbers,
+ - * /and parentheses combine references. A reference is a path into the JSON body (usage.prompt_tokens,choices[0].usage.total,data[id=gpt-x].pricing.prompt,["x-key"]for a key that is not a plain name),header.name(orheader["x-retry-count"]) for a response header, orrate.namefor a rate of the run's price profile.body.names the body explicitly where a key is calledheaderorrate.A reference yields a number, a string holding a number, or a boolean (1 / 0); anything else, or a reference that is not there, makes the value missing.
- BowirePriceProfile
#621 — the rates a run's cost expressions use, as they were when the run started: from configuration, or fetched from a provider that serves its own. Recorded in the report beside the cost they produced, so a figure is only ever compared with one made at the same rates.
- BowirePriceProfiles
#621 — price profiles from configuration, under
Bowire:Benchmark:PriceProfiles:<name>:"model-a": { "Rates": { "input": 0.0000030, "output": 0.0000150 } } "router-b": { "Url": "https://router.example/api/v1/models", "Rates": { "input": "data[id=model-b].pricing.prompt", "output": "data[id=model-b].pricing.completion" } }With a
Urlthe rates are paths into the provider's answer (the syntax of a metric expression's references), read once when the run starts.
- BowireRegistryProtocolResolver
Resolves scheduled runs' protocol plugins through the process-wide protocol registry — the same set the workbench and CLI discover.
- BowireResponseMetric
#621 — a value each response reports, declared for a run as
name=expression:tokens-out=usage.completion_tokens,cost=usage.prompt_tokens * rate.input + usage.completion_tokens * rate.output. It is evaluated per completed call and aggregated like a latency, so a threshold readscost-sum < 0.05ortokens-out-p95 < 2000.
- BowireResponseMetricEndpointContribution
#621 — mounts the response-metric API the Benchmarks rail evaluates through.
- BowireResponseMetricEndpoints
#621 — the HTTP surface behind the rail's response metrics. The rail runs its calls in the browser; the expressions are evaluated here, by the same code
bowire bench runuses, so a metric reads the same in both.
- BowireResponseMetricEvaluateRequest
#621 — a batch of responses to evaluate against the run's metrics, at the run's pinned rates.
- BowireResponseMetricPrepareRequest
#621 — a run's declared metrics and the price profile they read.
- BowireResponseMetricSample
#621 — one response to evaluate: its body and its headers.
- BowireResponseMetricStats
#621 — a response metric over a run: the aggregations of the values the calls reported, and how many did not report it, with the first reason.
- BowireResponseMetricValue
#621 — what one response gave a declared metric: its value, or why there is none.
- BowireScheduleEnabledRequest
Pause / resume body for the schedule endpoint.
- BowireThresholdResult
Outcome of checking one threshold against a run.
- BowireTimelineBucket
#623 — one slice of a run's wall clock: the calls that completed in it, how many failed, and the latency of the ones that did not.
Interfaces
- IBowireBenchmarkProtocolResolver
Resolves a protocol plugin by id for the scheduler. An interface rather than a direct registry call so the hosted service can be driven in a test without a plugin scan, and so a host can narrow which protocols scheduled runs may reach.
Enums
- BowireBenchmarkMetric
A metric a threshold can be set on (#360).
- BowireConnectionEnd
#624 — how a held connection ended.
- BowireMetricAggregation
#621 — how a response metric's values over a run are summed up for a threshold.
- BowireRunWindow
#623 — a part of a run a threshold can speak about.
- BowireThresholdOperator
Comparison a threshold applies between the measured value and the budget.