Compare commits

...

2 commits

Author SHA1 Message Date
c18b992f04 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
2024-12-30 23:20:13 +01:00
3a1e4fdc3c
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
2024-12-30 23:12:23 +01:00

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