pub struct SimpleMetrics { /* private fields */ }Expand description
Simple in-memory metrics implementation for standalone use
Implementations§
Source§impl SimpleMetrics
impl SimpleMetrics
Sourcepub fn get_counter(&self, counter: &str) -> Option<u64>
pub fn get_counter(&self, counter: &str) -> Option<u64>
Get a specific counter value
Sourcepub fn get_average_duration(&self, operation: &str) -> Option<Duration>
pub fn get_average_duration(&self, operation: &str) -> Option<Duration>
Get average operation duration
Trait Implementations§
Source§impl Debug for SimpleMetrics
impl Debug for SimpleMetrics
Source§impl Default for SimpleMetrics
impl Default for SimpleMetrics
Source§impl MetricsProvider for SimpleMetrics
impl MetricsProvider for SimpleMetrics
Source§fn record_operation(&self, operation: &str, duration: Duration)
fn record_operation(&self, operation: &str, duration: Duration)
Record the duration of an operation
Source§fn increment_counter(&self, counter: &str, value: u64)
fn increment_counter(&self, counter: &str, value: u64)
Increment a counter
Source§fn record_gauge(&self, gauge: &str, value: f64)
fn record_gauge(&self, gauge: &str, value: f64)
Record a gauge value
Source§fn timer<'a>(&'a self, operation: &'a str) -> OperationTimer<'a>
fn timer<'a>(&'a self, operation: &'a str) -> OperationTimer<'a>
Create a timer that will automatically record an operation
when it goes out of scope
Auto Trait Implementations§
impl !Freeze for SimpleMetrics
impl RefUnwindSafe for SimpleMetrics
impl Send for SimpleMetrics
impl Sync for SimpleMetrics
impl Unpin for SimpleMetrics
impl UnsafeUnpin for SimpleMetrics
impl UnwindSafe for SimpleMetrics
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