mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
metrics/influxdb: don't push empty histograms, no measurement != 0 (#22590)
This commit is contained in:
parent
ebbcd608cc
commit
d16c72edbe
1 changed files with 23 additions and 20 deletions
|
|
@ -137,6 +137,8 @@ func (r *reporter) send() error {
|
||||||
})
|
})
|
||||||
case metrics.Histogram:
|
case metrics.Histogram:
|
||||||
ms := metric.Snapshot()
|
ms := metric.Snapshot()
|
||||||
|
|
||||||
|
if ms.Count() > 0 {
|
||||||
ps := ms.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999, 0.9999})
|
ps := ms.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999, 0.9999})
|
||||||
pts = append(pts, client.Point{
|
pts = append(pts, client.Point{
|
||||||
Measurement: fmt.Sprintf("%s%s.histogram", namespace, name),
|
Measurement: fmt.Sprintf("%s%s.histogram", namespace, name),
|
||||||
|
|
@ -157,6 +159,7 @@ func (r *reporter) send() error {
|
||||||
},
|
},
|
||||||
Time: now,
|
Time: now,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
case metrics.Meter:
|
case metrics.Meter:
|
||||||
ms := metric.Snapshot()
|
ms := metric.Snapshot()
|
||||||
pts = append(pts, client.Point{
|
pts = append(pts, client.Point{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue