259
260
// Histogram obtains a histogram for the given name.
261
>
func (tmh *tallyMetricsHandler) Histogram(histogram string, unit MetricUnit) HistogramIface {
tally_metrics_handler.go
262
>
key := histogramCacheKey{name: histogram, unit: unit}
263
>
if v, ok := tmh.histograms.Load(key); ok {
264
return v.(HistogramIface) //nolint:revive // type-safe: only HistogramIface is stored
265
}
267
tmh.cachedTaggedScope(t).Histogram(histogram, tmh.perUnitBuckets[unit]).RecordValue(float64(i))
268
})
270
>
return actual.(HistogramIface) //nolint:revive // type-safe: only HistogramIface is stored
271
}
272