From 707267e4713999938ac26710a7da482e7392c284 Mon Sep 17 00:00:00 2001 From: Ade9 Date: Fri, 25 Apr 2025 09:40:10 +0300 Subject: [PATCH] only count completed requests as streamed or not --- llmproxymetrics.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/llmproxymetrics.go b/llmproxymetrics.go index 0cf0366..b8e3d61 100644 --- a/llmproxymetrics.go +++ b/llmproxymetrics.go @@ -115,11 +115,11 @@ func handleJsonLine(line []byte, wasstreamed int) { tokens_out.Add(jsonData["eval_count"].(float64)) tokens_in.Add(jsonData["prompt_eval_count"].(float64)) eval_time.Observe(duration) - } - if wasstreamed == 1 { - streamed.Inc() - } else if wasstreamed == 0 { - notStreamed.Inc() + if wasstreamed == 1 { + streamed.Inc() + } else if wasstreamed == 0 { + notStreamed.Inc() + } } }