pub struct MetricsCore { /* private fields */ }Expand description
Main metrics interface - the core of everything
Implementations§
Source§impl MetricsCore
impl MetricsCore
Sourcepub fn counter(&self, name: &'static str) -> Arc<Counter>
pub fn counter(&self, name: &'static str) -> Arc<Counter>
Get or create a counter by name. Requires the count feature.
Sourcepub fn gauge(&self, name: &'static str) -> Arc<Gauge>
pub fn gauge(&self, name: &'static str) -> Arc<Gauge>
Get or create a gauge by name. Requires the gauge feature.
Sourcepub fn timer(&self, name: &'static str) -> Arc<Timer>
pub fn timer(&self, name: &'static str) -> Arc<Timer>
Get or create a timer by name. Requires the timer feature.
Sourcepub fn time<T>(&self, name: &'static str, f: impl FnOnce() -> T) -> T
pub fn time<T>(&self, name: &'static str, f: impl FnOnce() -> T) -> T
Time a synchronous closure and record the elapsed duration.
Requires the timer feature.
Sourcepub fn system(&self) -> &SystemHealth
pub fn system(&self) -> &SystemHealth
Get system health interface
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetricsCore
impl RefUnwindSafe for MetricsCore
impl Send for MetricsCore
impl Sync for MetricsCore
impl Unpin for MetricsCore
impl UnsafeUnpin for MetricsCore
impl UnwindSafe for MetricsCore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more