MCPcopy Create free account
hub / github.com/cortexproject/cortex / NewPriorityQueue

Function NewPriorityQueue

pkg/util/priority_queue.go:46–53  ·  view source on GitHub ↗

NewPriorityQueue makes a new priority queue.

(lengthGauge prometheus.Gauge)

Source from the content-addressed store, hash-verified

44
45// NewPriorityQueue makes a new priority queue.
46func NewPriorityQueue(lengthGauge prometheus.Gauge) *PriorityQueue {
47 pq := &PriorityQueue{
48 lengthGauge: lengthGauge,
49 }
50 pq.cond = sync.NewCond(&pq.lock)
51 heap.Init(&pq.queue)
52 return pq
53}
54
55// Length returns the length of the queue.
56func (pq *PriorityQueue) Length() int {

Callers 7

TestPriorityRequestQueueFunction · 0.92
TestPriorityQueueBasicFunction · 0.85
TestPriorityQueueWaitFunction · 0.85
TestPriorityQueueCloseFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestPriorityRequestQueueFunction · 0.74
TestPriorityQueueBasicFunction · 0.68
TestPriorityQueueWaitFunction · 0.68
TestPriorityQueueCloseFunction · 0.68