MCPcopy Index your code
hub / github.com/prometheus/prometheus / newQueue

Function newQueue

storage/remote/queue_manager.go:1424–1438  ·  view source on GitHub ↗
(batchSize, capacity int)

Source from the content-addressed store, hash-verified

1422)
1423
1424func newQueue(batchSize, capacity int) *queue {
1425 batches := capacity / batchSize
1426 // Always create an unbuffered channel even if capacity is configured to be
1427 // less than max_samples_per_send.
1428 if batches == 0 {
1429 batches = 1
1430 }
1431 return &queue{
1432 batch: make([]timeSeries, 0, batchSize),
1433 batchQueue: make(chan []timeSeries, batches),
1434 // batchPool should have capacity for everything in the channel + 1 for
1435 // the batch being processed.
1436 batchPool: make([][]timeSeries, 0, batches+1),
1437 }
1438}
1439
1440// Append the timeSeries to the buffered batch. Returns false if it
1441// cannot be added and must be retried.

Callers 2

startMethod · 0.85

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…