Add stream label to TTFT metrics (#32363)

Co-authored-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
This commit is contained in:
cctry
2026-07-24 17:44:04 -07:00
committed by GitHub
co-authored by Jialin Ouyang
parent ce705bb6dc
commit a690e5e0b3
2 changed files with 12 additions and 5 deletions
@@ -2501,7 +2501,9 @@ class TokenizerManager(TokenizerControlMixin, TokenizerManagerScoreMixin):
state.ttft_observed = True
state.last_completion_tokens = completion_tokens
self.metrics_collector.observe_time_to_first_token(
labels, state.time_stats.get_first_token_latency()
labels,
state.time_stats.get_first_token_latency(),
stream=getattr(state.obj, "stream", False),
)
else:
num_new_tokens = completion_tokens - state.last_completion_tokens