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

Method Collect

pkg/util/metrics_helper.go:549–556  ·  view source on GitHub ↗
(out chan<- prometheus.Metric)

Source from the content-addressed store, hash-verified

547}
548
549func (h *HistogramDataCollector) Collect(out chan<- prometheus.Metric) {
550 h.dataMu.RLock()
551 defer h.dataMu.RUnlock()
552
553 // We must create a copy of the HistogramData data structure before calling Metric()
554 // to honor its contract.
555 out <- h.data.Copy().Metric(h.desc)
556}
557
558func (h *HistogramDataCollector) Add(hd HistogramData) {
559 h.dataMu.Lock()

Callers 1

GetLabelsFunction · 0.45

Calls 2

MetricMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected