#[cfg(feature = "metrics")]
macro_rules! counter {
($($arg:tt)*) => {
::metrics::counter!($($arg)*)
};
}
#[cfg(feature = "metrics")]
macro_rules! histogram {
($($arg:tt)*) => {
::metrics::histogram!($($arg)*)
};
}
#[cfg(feature = "metrics")]
macro_rules! gauge {
($($arg:tt)*) => {
::metrics::gauge!($($arg)*)
};
}
#[cfg(not(feature = "metrics"))]
pub(crate) struct NoopMetric;
#[cfg(not(feature = "metrics"))]
impl NoopMetric {
#[inline(always)]
pub(crate) fn increment(&self, _value: u64) {}
#[inline(always)]
pub(crate) fn record(&self, _value: f64) {}
#[inline(always)]
pub(crate) fn set(&self, _value: f64) {}
}
#[cfg(not(feature = "metrics"))]
macro_rules! counter {
($($arg:tt)*) => {
$crate::metrics_shim::NoopMetric
};
}
#[cfg(not(feature = "metrics"))]
macro_rules! histogram {
($($arg:tt)*) => {
$crate::metrics_shim::NoopMetric
};
}
#[cfg(not(feature = "metrics"))]
macro_rules! gauge {
($($arg:tt)*) => {
$crate::metrics_shim::NoopMetric
};
}
pub(crate) use counter;
pub(crate) use gauge;
pub(crate) use histogram;