Skip to main content

Module metrics

Module metrics 

Source
Expand description

Observability for the streaming engine.

The scheduler can optionally report, for every completed HTTP request, a RequestStats record and, when the stream ends, an aggregate StreamSummary. These are surfaced through the StreamObserver trait, which is attached explicitly via Client::stream_arrow_with_observer.

StreamMetrics is a ready-made, thread-safe observer implementation (atomics plus a small fixed histogram) that the caller constructs, passes in, and reads from during or after the stream. Power users can implement StreamObserver themselves to collect raw RequestStats (for exact percentiles, custom exporters, etc.).

When no observer is attached the engine does no metrics work at all — there is zero overhead on the default streaming paths.

Structs§

RequestStats
Metrics for a single completed HTTP request, reported via StreamObserver::on_request.
StreamMetrics
Thread-safe aggregate metrics handle.
StreamSummary
Aggregate summary of a stream run, produced by StreamMetrics::summary and passed to StreamObserver::on_finish.

Enums§

RequestKind
Whether a scheduled request extended the frontier or backfilled a gap left by an earlier truncated response.

Constants§

NUM_SIZE_BUCKETS
Number of size-vs-target histogram buckets.
SIZE_BUCKET_LABELS
Human-readable labels for the size-vs-target histogram buckets, relative to response_bytes_target.

Traits§

StreamObserver
Observer that receives streaming metrics.