mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
improve remote storage enqueue performance (#4772)
Signed-off-by: fyc <fyc22788@ly.com>
This commit is contained in:
parent
8edaa8ad4d
commit
94fff219ab
|
@ -149,7 +149,7 @@ type QueueManager struct {
|
|||
queueName string
|
||||
logLimiter *rate.Limiter
|
||||
|
||||
shardsMtx sync.Mutex
|
||||
shardsMtx sync.RWMutex
|
||||
shards *shards
|
||||
numShards int
|
||||
reshardChan chan int
|
||||
|
@ -218,9 +218,9 @@ func (t *QueueManager) Append(s *model.Sample) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
t.shardsMtx.Lock()
|
||||
t.shardsMtx.RLock()
|
||||
enqueued := t.shards.enqueue(&snew)
|
||||
t.shardsMtx.Unlock()
|
||||
t.shardsMtx.RUnlock()
|
||||
|
||||
if enqueued {
|
||||
queueLength.WithLabelValues(t.queueName).Inc()
|
||||
|
|
Loading…
Reference in a new issue