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

Method getOrCreateQueue

modules/distributor/forwarder.go:112–125  ·  view source on GitHub ↗
(tenantID string)

Source from the content-addressed store, hash-verified

110}
111
112func (f *generatorForwarder) getOrCreateQueue(tenantID string) *queue.Queue[*request] {
113 q, ok := f.getQueue(tenantID)
114 if ok {
115 return q
116 }
117
118 f.mutex.Lock()
119 defer f.mutex.Unlock()
120
121 queueSize, workerCount := f.getQueueConfig(tenantID)
122 f.queues[tenantID] = f.createQueueAndStartWorkers(tenantID, queueSize, workerCount)
123
124 return f.queues[tenantID]
125}
126
127func (f *generatorForwarder) getQueue(tenantID string) (*queue.Queue[*request], bool) {
128 f.mutex.RLock()

Callers 1

SendTracesMethod · 0.95

Calls 3

getQueueMethod · 0.95
getQueueConfigMethod · 0.95

Tested by

no test coverage detected