pub struct PerformanceMonitor { /* private fields */ }
Expand description
Performance monitoring utilities with enhanced memory profiling
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
Sourcepub fn start(_operationname: String) -> Self
pub fn start(_operationname: String) -> Self
Start monitoring a new operation with memory profiling
Sourcepub fn start_with_config(operation_name: String, sample_intervalms: u64) -> Self
pub fn start_with_config(operation_name: String, sample_intervalms: u64) -> Self
Start monitoring with custom sampling interval
Sourcepub fn record_memory(&mut self, currentmemory: usize)
pub fn record_memory(&mut self, currentmemory: usize)
Manually record current memory usage
Sourcepub fn record_allocation(&self, size: usize)
pub fn record_allocation(&self, size: usize)
Record an allocation event
Sourcepub fn record_deallocation(&self, size: usize)
pub fn record_deallocation(&self, size: usize)
Record a deallocation event
Sourcepub fn get_memory_metrics(&self) -> MemoryMetrics
pub fn get_memory_metrics(&self) -> MemoryMetrics
Get current memory metrics
Sourcepub fn check_memory_health(&self) -> Vec<String>
pub fn check_memory_health(&self) -> Vec<String>
Check for memory health issues
Sourcepub fn get_memory_timeline(&self) -> Vec<(f64, usize)>
pub fn get_memory_timeline(&self) -> Vec<(f64, usize)>
Get memory timeline for analysis
Sourcepub fn update_memory(&mut self, currentmemory: usize)
pub fn update_memory(&mut self, currentmemory: usize)
Update peak memory usage (legacy method)
Sourcepub fn finish(self) -> PerformanceReport
pub fn finish(self) -> PerformanceReport
Finish monitoring and return comprehensive performance metrics
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more