Skip to content

Commit

Permalink
fix: dec aggregator.Result invoke times
Browse files Browse the repository at this point in the history
  • Loading branch information
ev1lQuark committed Jul 20, 2023
1 parent 0d4b7c7 commit 13331a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions metrics/prometheus/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,10 @@ func (gv *aggregateFunctionsGaugeVec) update(labels *prometheus.Labels, curValue
cur.Add(float64(curValue))

updateFunc := func(aggregator *aggregate.TimeWindowAggregator) {
gv.min.With(*labels).Set(aggregator.Result().Min)
gv.max.With(*labels).Set(aggregator.Result().Max)
gv.avg.With(*labels).Set(aggregator.Result().Avg)
result := aggregator.Result()
gv.min.With(*labels).Set(result.Min)
gv.max.With(*labels).Set(result.Max)
gv.avg.With(*labels).Set(result.Avg)
}

if actual, loaded := gv.syncMap.LoadOrStore(key, cur); loaded {
Expand Down

0 comments on commit 13331a4

Please sign in to comment.