fix(metrics): add cumulative count as histogram expects #57
1 changed files with 3 additions and 1 deletions
|
@ -193,10 +193,12 @@ func (m *Metrics) collectReqeustDataMetrics(ch chan<- prometheus.Metric, queue *
|
||||||
sum += latency
|
sum += latency
|
||||||
count++
|
count++
|
||||||
|
|
||||||
|
var cumulativeCount uint64
|
||||||
for _, bound := range bucketBounds {
|
for _, bound := range bucketBounds {
|
||||||
if latency <= bound {
|
if latency <= bound {
|
||||||
buckets[bound]++
|
cumulativeCount++
|
||||||
}
|
}
|
||||||
|
buckets[bound] += cumulativeCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue