From 3de51181ec3a4809c4f2733d0dd731d4d4558301 Mon Sep 17 00:00:00 2001 From: shishirng Date: Fri, 19 May 2023 11:00:32 -0400 Subject: [PATCH] Fix setting minscore - initialized to 0 (#1725) Signed-off-by: shishir gowda --- pkg/telemetry/statsworker.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/telemetry/statsworker.go b/pkg/telemetry/statsworker.go index 37dbc3aeb..f963097ee 100644 --- a/pkg/telemetry/statsworker.go +++ b/pkg/telemetry/statsworker.go @@ -159,7 +159,9 @@ func coalesce(stats []*livekit.AnalyticsStat) *livekit.AnalyticsStat { // only consider non-zero scores if stat.Score > 0 { - if stat.Score < minScore { + if minScore == 0 { + minScore = stat.Score + } else if stat.Score < minScore { minScore = stat.Score } scoreSum += stat.Score