fix(metrics): add cumulative count as histogram expects
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Tom Neuber 2024-12-30 23:12:23 +01:00
parent 3122b6e630
commit 3a1e4fdc3c
Signed by: tom
GPG key ID: F17EFE4272D89FF6

View file

@ -193,10 +193,12 @@ func (m *Metrics) collectReqeustDataMetrics(ch chan<- prometheus.Metric, queue *
sum += latency
count++
var cumulativeCount uint64
for _, bound := range bucketBounds {
if latency <= bound {
buckets[bound]++
cumulativeCount++
}
buckets[bound] += cumulativeCount
}
}