Expand description
2026-09-26: Arrival-gap accumulator: the within-response jitter instrument.
An arrival is one socket read that carried at least one token delta
(chat_stream_inner in http.rs); a gap is the time between two
consecutive arrivals of one response. Gaps are taken per read, not per
token: several deltas that arrive in one read are one arrival.
Count, mean and variance are kept online (Welford in push, Chan’s
update in merge) with a running max. Percentiles need the samples, so
gaps are retained as f32 up to RETAIN_CAP per response; past that
the online statistics keep counting and GapStats::retained says how
many gaps the percentiles cover. A cell pools its requests with
GapSample::merge. stability and the coefficient of variation are
derived from the primitives by GapStats; for both, lower is better.
Owner: bench (HTTP client). Invariants:
- A
GapSamplenever retains more gaps than it has counted. GapSample::statsisNoneexactly when no gap was recorded.
Structs§
- GapSample
- 2026-09-26: Online accumulator of one response’s arrival gaps (or a pool of them).
- GapStats
- 2026-09-26: One response’s (or one pool’s) arrival-gap distribution, in ms.
Constants§
- RETAIN_
CAP - 2026-09-26: Gaps retained per response for the percentiles. Equal to the
concurrency driver’s largest
osl, which is itsmax_tokens, so no concurrency response is truncated; a longer response keeps counting online and reports the truncation throughGapStats::retained.
Functions§
- itl_ms
- 2026-09-26: Inter-token latency:
decode_window_ms / (output_tokens − 1). The one definition both clocks use: the client passes its first-delta → stream-end window, andChatOutcome::server_tpot_mspasses the endpoint’susage.decode_time_ms.