MCPcopy
hub / github.com/grafana/dskit / New

Function New

gate/gate.go:50–52  ·  view source on GitHub ↗

New returns an instrumented gate limiting the number of requests being executed concurrently. The gate implementation is based on the github.com/prometheus/prometheus/util/gate package. It can be called several times but not with the same registerer otherwise it will panic when trying to register

(reg prometheus.Registerer, maxConcurrent int)

Source from the content-addressed store, hash-verified

48// It can be called several times but not with the same registerer otherwise it
49// will panic when trying to register the same metric multiple times.
50func New(reg prometheus.Registerer, maxConcurrent int) Gate {
51 return NewInstrumented(reg, maxConcurrent, NewBlocking(maxConcurrent))
52}
53
54// NewInstrumented wraps a Gate implementation with one that records max number of inflight
55// requests, currently inflight requests, and the duration of calls to the Start method.

Callers 1

newMemcachedClientFunction · 0.92

Calls 2

NewInstrumentedFunction · 0.85
NewBlockingFunction · 0.85

Tested by

no test coverage detected