Open 0xdeafbeef opened 3 weeks ago
Maybe even for backward compatibility
pub trait HistogramFn {
/// Records a value into the histogram.
fn record(&self, value: f64);
fn record_many(&self, value: f64, count: u64) {
for _ in 0..count {
self.record(value);
}
}
}
I can open a pr if you agree with such an interface.
Overall, I'm fine with the idea of adding HistogramFn::record_many
with the proposed method signature. I would definitely want the second version so that we can add it as a non-breaking change, and I would gladly accept a PR for that implementation. 👍🏻
I want to reexport tokio metrics, they already provide bucketed data. To reexport it, you should write such code:
Is it possible to add
to
HistogramFn
to not burn cpu cycles? Or maybe there is a better way?