Skip to content

Commit

Permalink
go.d cockroachdb fix calculation (netdata#17659)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 committed May 14, 2024
1 parent 258badc commit 4623e9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/go/collectors/go.d.plugin/modules/cockroachdb/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const precision = 1000
func collectScraped(scraped prometheus.Series, metricList []string) map[string]float64 {
mx := make(map[string]float64)
for _, name := range metricList {
if ms := scraped.FindByName(name); ms.Len() == 1 {
for _, m := range scraped.FindByName(name) {
if isMetricFloat(name) {
mx[name] = ms.Max() * precision
mx[name] += m.Value * precision
} else {
mx[name] = ms.Max()
mx[name] += m.Value
}
}
}
Expand Down

0 comments on commit 4623e9b

Please sign in to comment.