[Metrics] Add audio SLOs + cross-stage transfer families + per-(stage, replica) wrap for upstream vllm:* (#3576)

Signed-off-by: vraiti <vraiti@redhat.com>
Signed-off-by: LHXuuu <xulianhao.xlh@antgroup.com>
Co-authored-by: vraiti <vraiti@redhat.com>
This commit is contained in:
LHXuuuandvraiti authored and GitHub committed 2026-06-01 20:20:48 +08:00
1 parent ee33601571
commit 41a795b5d6
29 files changed
+3377 -25

No files matched your search

@@ -17,3 +17,23 @@ class ClientRequestState:
self.stage_id: int | None = None
self.queue = queue if queue is not None else asyncio.Queue()
self.metrics: OrchestratorAggregator | None = None
# Wall-clock time at which the user's request arrived in the engine
# entrypoint. Set in async_omni.generate() before the orchestrator
# accepts the request. Used as the t0 anchor for audio_ttfp.
self.request_arrival_ts: float = 0.0
# Wall-clock time at which the first audio packet was observed for
# this request. None means the streaming hook hasn't fired yet.
# Used as the once-per-request guard for audio_ttfp_s emit.
self.first_audio_ts: float | None = None
# Per-chunk timeline (seconds since request_arrival_ts) and PCM byte
# counts for the audio streaming response. Populated by the streaming
# endpoint on every audio.chunk emit; consumed at request finalize to
# compute audio_underrun_s and audio_continuity_ok_total.
self.audio_chunk_arrivals_s: list[float] = []
self.audio_chunk_bytes: list[int] = []
self.audio_sample_rate: int | None = None
# Stage / replica that produced the audio packets — captured at the
# first-packet hook so the finalize-time emit can label correctly
# without re-querying stage_pools.
self.audio_emit_stage_id: int | None = None
self.audio_emit_replica_id: int | None = None