pub struct PerformanceMonitor { /* private fields */ }
Expand description
High-performance monitor with minimal overhead
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
Sourcepub fn with_config(config: MonitorConfig) -> Self
pub fn with_config(config: MonitorConfig) -> Self
Create a new performance monitor with custom configuration
Sourcepub fn time(&self, counter_type: CounterType) -> Timer<'_>
pub fn time(&self, counter_type: CounterType) -> Timer<'_>
Start timing an operation
Sourcepub fn record(&self, counter_type: CounterType, duration: Duration)
pub fn record(&self, counter_type: CounterType, duration: Duration)
Record a measurement manually
Sourcepub fn record_with_size(
&self,
counter_type: CounterType,
duration: Duration,
size: Option<usize>,
)
pub fn record_with_size( &self, counter_type: CounterType, duration: Duration, size: Option<usize>, )
Record a measurement with size information
Sourcepub fn stats(&self, counter_type: &CounterType) -> Option<CounterStats>
pub fn stats(&self, counter_type: &CounterType) -> Option<CounterStats>
Get statistics for a counter type
Sourcepub fn all_stats(&self) -> HashMap<CounterType, CounterStats>
pub fn all_stats(&self) -> HashMap<CounterType, CounterStats>
Get all counter statistics
Sourcepub fn total_runtime(&self) -> Duration
pub fn total_runtime(&self) -> Duration
Get total runtime since monitor creation
Sourcepub fn report(&self) -> PerformanceReport
pub fn report(&self) -> PerformanceReport
Generate a performance report
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get memory usage of the monitor itself
Trait Implementations§
Source§impl Debug for PerformanceMonitor
impl Debug for PerformanceMonitor
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