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)
| 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. |
| 50 | func 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. |
no test coverage detected