reset counter after collecting metric (#6798)
Signed-off-by: HelenXu <helenxu@Helens-MacBook-Pro.local>
This commit is contained in:
parent
ff0003e072
commit
7df4fe3faa
|
@ -825,8 +825,8 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue chan sample) {
|
||||||
if nPending > 0 {
|
if nPending > 0 {
|
||||||
level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending samples", "samples", nPending, "shard", shardNum)
|
level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending samples", "samples", nPending, "shard", shardNum)
|
||||||
s.sendSamples(ctx, pendingSamples[:nPending], &buf)
|
s.sendSamples(ctx, pendingSamples[:nPending], &buf)
|
||||||
nPending = 0
|
|
||||||
s.qm.pendingSamplesMetric.Sub(float64(nPending))
|
s.qm.pendingSamplesMetric.Sub(float64(nPending))
|
||||||
|
nPending = 0
|
||||||
}
|
}
|
||||||
timer.Reset(time.Duration(s.qm.cfg.BatchSendDeadline))
|
timer.Reset(time.Duration(s.qm.cfg.BatchSendDeadline))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue