mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
metrics/influxdb: temp solution to present counter meaningfully (#24811)
This commit is contained in:
parent
d77c1e5ea3
commit
7b0a7e4593
1 changed files with 2 additions and 4 deletions
|
|
@ -104,17 +104,15 @@ func (r *reporter) send() error {
|
||||||
|
|
||||||
switch metric := i.(type) {
|
switch metric := i.(type) {
|
||||||
case metrics.Counter:
|
case metrics.Counter:
|
||||||
v := metric.Count()
|
count := metric.Count()
|
||||||
l := r.cache[name]
|
|
||||||
pts = append(pts, client.Point{
|
pts = append(pts, client.Point{
|
||||||
Measurement: fmt.Sprintf("%s%s.count", namespace, name),
|
Measurement: fmt.Sprintf("%s%s.count", namespace, name),
|
||||||
Tags: r.tags,
|
Tags: r.tags,
|
||||||
Fields: map[string]interface{}{
|
Fields: map[string]interface{}{
|
||||||
"value": v - l,
|
"value": count,
|
||||||
},
|
},
|
||||||
Time: now,
|
Time: now,
|
||||||
})
|
})
|
||||||
r.cache[name] = v
|
|
||||||
case metrics.Gauge:
|
case metrics.Gauge:
|
||||||
ms := metric.Snapshot()
|
ms := metric.Snapshot()
|
||||||
pts = append(pts, client.Point{
|
pts = append(pts, client.Point{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue