reset counter after collecting metric (#6798)

Signed-off-by: HelenXu <helenxu@Helens-MacBook-Pro.local>
This commit is contained in:
helenxu1221 2020-02-09 22:51:21 -05:00 committed by GitHub
parent ff0003e072
commit 7df4fe3faa
1 changed files with 1 additions and 1 deletions

View File

@ -825,8 +825,8 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue chan sample) {
if nPending > 0 {
level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending samples", "samples", nPending, "shard", shardNum)
s.sendSamples(ctx, pendingSamples[:nPending], &buf)
nPending = 0
s.qm.pendingSamplesMetric.Sub(float64(nPending))
nPending = 0
}
timer.Reset(time.Duration(s.qm.cfg.BatchSendDeadline))
}