mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 16:43:21 +00:00
Update the runShard method and change len(pendingSamples) to n=len(pendingSamples) (#5708)
Signed-off-by: xigang <wangxigang2014@gmail.com>
This commit is contained in:
parent
fc3b772342
commit
445bcd1251
@ -680,9 +680,9 @@ func (s *shards) runShard(ctx context.Context, i int, queue chan prompb.TimeSeri
|
||||
}
|
||||
|
||||
case <-timer.C:
|
||||
if len(pendingSamples) > 0 {
|
||||
level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending samples", "samples", len(pendingSamples), "shard", shardNum)
|
||||
n := len(pendingSamples)
|
||||
n := len(pendingSamples)
|
||||
if n > 0 {
|
||||
level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending samples", "samples", n, "shard", shardNum)
|
||||
s.sendSamples(ctx, pendingSamples, &buf)
|
||||
pendingSamples = pendingSamples[:0]
|
||||
s.qm.pendingSamplesMetric.Sub(float64(n))
|
||||
|
Loading…
Reference in New Issue
Block a user