MCPcopy Create free account
hub / github.com/coder/coder / handleMessagePartEvent

Method handleMessagePartEvent

scaletest/chat/run.go:340–352  ·  view source on GitHub ↗
(ctx context.Context, logger slog.Logger)

Source from the content-addressed store, hash-verified

338}
339
340func (r *Runner) handleMessagePartEvent(ctx context.Context, logger slog.Logger) {
341 if r.sawTurnFirstOutput {
342 return
343 }
344 r.sawTurnFirstOutput = true
345 r.result.sawFirstOutput = true
346 firstOutputDuration := time.Since(r.turnStartTime)
347 r.cfg.Metrics.ChatTimeToFirstOutputSeconds.WithLabelValues(r.currentPhase).Observe(firstOutputDuration.Seconds())
348 logger.Info(ctx, "chat received first output",
349 slog.F("phase", r.currentPhase),
350 slog.F("duration", firstOutputDuration),
351 )
352}
353
354func (r *Runner) handleRetryEvent(ctx context.Context, logger slog.Logger, retry *codersdk.ChatStreamRetry) {
355 r.result.retryCount++

Callers 1

runConversationMethod · 0.95

Calls 2

WithLabelValuesMethod · 0.80
InfoMethod · 0.45

Tested by

no test coverage detected