pub trait MetricEmitter {
fn record_counter(&mut self, instrument: &'static str, value: u64, unit: Option<&'static str>);
fn record_gauge_u64(
&mut self,
instrument: &'static str,
value: u64,
unit: Option<&'static str>,
);
fn record_gauge_f64(
&mut self,
instrument: &'static str,
value: f64,
unit: Option<&'static str>,
);
fn record_histogram(
&mut self,
instrument: &'static str,
value: f64,
unit: Option<&'static str>,
bounds: &'static [f64],
);
fn with_attributes(&mut self, attrs: &[(&'static str, &str)]);
}
#[derive(Debug, Default, Clone, Copy)]
pub struct NoopMetricEmitter;
impl MetricEmitter for NoopMetricEmitter {
fn record_counter(&mut self, _: &'static str, _: u64, _: Option<&'static str>) {}
fn record_gauge_u64(&mut self, _: &'static str, _: u64, _: Option<&'static str>) {}
fn record_gauge_f64(&mut self, _: &'static str, _: f64, _: Option<&'static str>) {}
fn record_histogram(
&mut self,
_: &'static str,
_: f64,
_: Option<&'static str>,
_: &'static [f64],
) {
}
fn with_attributes(&mut self, _: &[(&'static str, &str)]) {}
}