Method
Collect
(out chan<- prometheus.Metric)
Source from the content-addressed store, hash-verified
| 547 | } |
| 548 | |
| 549 | func (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 | |
| 558 | func (h *HistogramDataCollector) Add(hd HistogramData) { |
| 559 | h.dataMu.Lock() |
Tested by
no test coverage detected