Merge pull request 'fix(metrics): add cumulative count as histogram expects' (#57) from tn-fix-histogram-quantile-monotonicity into main
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
ci/woodpecker/push/deploy Pipeline was successful

Reviewed-on: #57
This commit is contained in:
Tom Neuber 2024-12-30 23:20:13 +01:00
commit c18b992f04

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
}
}