Skip to content

Commit

Permalink
collector: Fix histogram
Browse files Browse the repository at this point in the history
Signed-off-by: Ondra Machacek <[email protected]>
  • Loading branch information
machacekondra committed Oct 23, 2024
1 parent 2482490 commit abdad09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/agent/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ func histogram(d []int) struct {
binIndex := int(float64(data-minVal) / binSize)
if binIndex == numberOfBins {
binIndex--
} else if binIndex < 0 {
binIndex = 0
}
bins[binIndex]++
}
Expand Down

0 comments on commit abdad09

Please sign in to comment.