pub struct PerformanceMonitor { /* private fields */ }Expand description
Performance monitoring utilities
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
Sourcepub fn start_timer(&mut self, operation: &str) -> TimerGuard<'_>
pub fn start_timer(&mut self, operation: &str) -> TimerGuard<'_>
Start timing an operation
Sourcepub fn record_metric(&mut self, name: String, value: MetricValue)
pub fn record_metric(&mut self, name: String, value: MetricValue)
Record a metric
Sourcepub fn increment_counter(&mut self, name: &str)
pub fn increment_counter(&mut self, name: &str)
Increment counter
Sourcepub fn record_gauge(&mut self, name: &str, value: f64)
pub fn record_gauge(&mut self, name: &str, value: f64)
Record gauge value
Sourcepub fn metrics(&self) -> &HashMap<String, MetricValue>
pub fn metrics(&self) -> &HashMap<String, MetricValue>
Get all metrics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PerformanceMonitor
impl RefUnwindSafe for PerformanceMonitor
impl Send for PerformanceMonitor
impl Sync for PerformanceMonitor
impl Unpin for PerformanceMonitor
impl UnwindSafe for PerformanceMonitor
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