MCPcopy
hub / github.com/grafana/tempo / NewRequestQueue

Function NewRequestQueue

modules/frontend/queue/queue.go:60–72  ·  view source on GitHub ↗
(maxOutstandingPerTenant int, queueLength *prometheus.GaugeVec, batchWeight *prometheus.HistogramVec, discardedRequests *prometheus.CounterVec)

Source from the content-addressed store, hash-verified

58}
59
60func NewRequestQueue(maxOutstandingPerTenant int, queueLength *prometheus.GaugeVec, batchWeight *prometheus.HistogramVec, discardedRequests *prometheus.CounterVec) *RequestQueue {
61 q := &RequestQueue{
62 queues: newUserQueues(maxOutstandingPerTenant),
63 queueLength: queueLength,
64 batchWeight: batchWeight,
65 discardedRequests: discardedRequests,
66 }
67
68 q.cond = contextCond{Cond: sync.NewCond(&q.mtx)}
69 q.Service = services.NewTimerService(queueCleanupPeriod, nil, q.cleanupQueues, q.stopping).WithName("request queue")
70
71 return q
72}
73
74// EnqueueRequest puts the request into the queue.
75//

Callers 2

NewFunction · 0.92
queueWithListenersFunction · 0.85

Calls 1

newUserQueuesFunction · 0.85

Tested by 1

queueWithListenersFunction · 0.68