Expand description
Lightweight session telemetry — atomic fast-lane counters + periodic aggregation.
All hot-path operations (counter increments, timestamp recording) are lock-free and zero-allocation (~1ns per call). Aggregation only happens periodically on the telemetry lane or at turn boundaries, ensuring no impact on the latency-sensitive audio pipeline.
The number a voice product is judged on is response latency: the time
from the user’s end of speech to the model’s first audio byte. It is
recorded per turn into LatencyStats — last, min, max, mean, the p50/
p90/p99 of recent turns, and a fixed-bucket histogram — and read through
SessionTelemetry::latency or SessionTelemetry::snapshot.
Structs§
- Latency
Bucket - One bucket of the response-latency histogram.
- Latency
Stats - Response-latency distribution for the session so far.
- Session
Telemetry - Zero-overhead telemetry collector for speech-to-speech sessions.
Constants§
- LATENCY_
BUCKETS_ MS - Upper bounds, in milliseconds, of the response-latency histogram buckets.
- LATENCY_
RECENT_ WINDOW - Number of most-recent samples the percentiles are computed over.