Skip to content

Commit

Permalink
metrics/influxdb: temp solution to present counter meaningfully (ethe…
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan authored and JukLee0ira committed Dec 22, 2024
1 parent 493bf61 commit d7c3e82
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions metrics/influxdb/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,15 @@ func (r *reporter) send() error {

switch metric := i.(type) {
case metrics.Counter:
v := metric.Count()
l := r.cache[name]
count := metric.Count()
pts = append(pts, client.Point{
Measurement: fmt.Sprintf("%s%s.count", namespace, name),
Tags: r.tags,
Fields: map[string]interface{}{
"value": v - l,
"value": count,
},
Time: now,
})
r.cache[name] = v
case metrics.Gauge:
ms := metric.Snapshot()
pts = append(pts, client.Point{
Expand Down

0 comments on commit d7c3e82

Please sign in to comment.