[PD] Improve disaggregation metrics output: update the metrics to keep reflecting real stats (#7317)

This commit is contained in:
SCDESPERTATE
2025-08-24 23:16:43 -07:00
committed by GitHub
parent ca4b86c564
commit b5c6529e17
4 changed files with 28 additions and 5 deletions
+5 -5
View File
@@ -142,7 +142,7 @@ class SchedulerStats:
spec_accept_length: float = 0.0
avg_request_queue_latency: float = 0.0
num_prefill_prealloc_queue_reqs: int = 0
num_prefill_infight_queue_reqs: int = 0
num_prefill_inflight_queue_reqs: int = 0
num_decode_prealloc_queue_reqs: int = 0
num_decode_transfer_queue_reqs: int = 0
total_retracted_reqs: int = 0
@@ -235,9 +235,9 @@ class SchedulerMetricsCollector:
multiprocess_mode="mostrecent",
)
self.num_prefill_infight_queue_reqs = Gauge(
name="sglang:num_prefill_infight_queue_reqs",
documentation="The number of requests in the prefill infight queue.",
self.num_prefill_inflight_queue_reqs = Gauge(
name="sglang:num_prefill_inflight_queue_reqs",
documentation="The number of requests in the prefill inflight queue.",
labelnames=labels.keys(),
multiprocess_mode="mostrecent",
)
@@ -294,7 +294,7 @@ class SchedulerMetricsCollector:
self.num_prefill_prealloc_queue_reqs, stats.num_prefill_prealloc_queue_reqs
)
self._log_gauge(
self.num_prefill_infight_queue_reqs, stats.num_prefill_infight_queue_reqs
self.num_prefill_inflight_queue_reqs, stats.num_prefill_inflight_queue_reqs
)
self._log_gauge(
self.num_decode_prealloc_queue_reqs, stats.num_decode_prealloc_queue_reqs