pub struct MemoryMetricsCollection { /* private fields */ }
Expand description
Container for tracking memory metrics across multiple algorithms
Implementations§
Source§impl MemoryMetricsCollection
impl MemoryMetricsCollection
Sourcepub fn with_algorithms(algorithms: &[AlgorithmType]) -> Self
pub fn with_algorithms(algorithms: &[AlgorithmType]) -> Self
Create collection with specific algorithms
Sourcepub fn add_algorithm(&mut self, algorithm_type: AlgorithmType)
pub fn add_algorithm(&mut self, algorithm_type: AlgorithmType)
Add an algorithm to tracking
Sourcepub fn remove_algorithm(
&mut self,
algorithm_type: AlgorithmType,
) -> Option<MemoryMetrics>
pub fn remove_algorithm( &mut self, algorithm_type: AlgorithmType, ) -> Option<MemoryMetrics>
Remove an algorithm from tracking
Sourcepub fn update_algorithm(
&mut self,
algorithm_type: AlgorithmType,
current_bytes: usize,
)
pub fn update_algorithm( &mut self, algorithm_type: AlgorithmType, current_bytes: usize, )
Update memory usage for an algorithm
Sourcepub fn get_metrics(
&self,
algorithm_type: AlgorithmType,
) -> Option<&MemoryMetrics>
pub fn get_metrics( &self, algorithm_type: AlgorithmType, ) -> Option<&MemoryMetrics>
Get metrics for specific algorithm
Sourcepub fn get_metrics_mut(
&mut self,
algorithm_type: AlgorithmType,
) -> Option<&mut MemoryMetrics>
pub fn get_metrics_mut( &mut self, algorithm_type: AlgorithmType, ) -> Option<&mut MemoryMetrics>
Get mutable metrics for specific algorithm
Sourcepub fn get_all_metrics(&self) -> &HashMap<AlgorithmType, MemoryMetrics>
pub fn get_all_metrics(&self) -> &HashMap<AlgorithmType, MemoryMetrics>
Get all metrics
Sourcepub fn get_sorted_metrics(&self) -> Vec<(AlgorithmType, &MemoryMetrics)>
pub fn get_sorted_metrics(&self) -> Vec<(AlgorithmType, &MemoryMetrics)>
Get metrics as a sorted vector for display
Sourcepub fn get_global_peak(&self) -> usize
pub fn get_global_peak(&self) -> usize
Get global peak memory usage
Sourcepub fn get_total_current_usage(&self) -> usize
pub fn get_total_current_usage(&self) -> usize
Get total current memory usage across all algorithms
Sourcepub fn get_total_peak_usage(&self) -> usize
pub fn get_total_peak_usage(&self) -> usize
Get total peak memory usage across all algorithms
Sourcepub fn set_real_time_enabled(&mut self, enabled: bool)
pub fn set_real_time_enabled(&mut self, enabled: bool)
Enable or disable real-time updates
Sourcepub fn is_real_time_enabled(&self) -> bool
pub fn is_real_time_enabled(&self) -> bool
Check if real-time updates are enabled
Sourcepub fn set_update_frequency(&mut self, frequency: Duration)
pub fn set_update_frequency(&mut self, frequency: Duration)
Set update frequency for real-time updates
Sourcepub fn get_update_frequency(&self) -> Duration
pub fn get_update_frequency(&self) -> Duration
Get update frequency
Sourcepub fn get_stale_algorithms(&self, threshold: Duration) -> Vec<AlgorithmType>
pub fn get_stale_algorithms(&self, threshold: Duration) -> Vec<AlgorithmType>
Get algorithms that need updates (based on staleness)
Sourcepub fn get_memory_display_values(
&self,
) -> Vec<(AlgorithmType, MemoryDisplayValue)>
pub fn get_memory_display_values( &self, ) -> Vec<(AlgorithmType, MemoryDisplayValue)>
Get memory display values for all algorithms
Sourcepub fn get_statistics(&self) -> MemoryStatistics
pub fn get_statistics(&self) -> MemoryStatistics
Get memory statistics summary
Sourcepub fn has_active_usage(&self) -> bool
pub fn has_active_usage(&self) -> bool
Check if any algorithm is currently using memory
Sourcepub fn get_highest_current_usage(&self) -> Option<(AlgorithmType, usize)>
pub fn get_highest_current_usage(&self) -> Option<(AlgorithmType, usize)>
Get algorithm with highest current memory usage
Sourcepub fn get_highest_peak_usage(&self) -> Option<(AlgorithmType, usize)>
pub fn get_highest_peak_usage(&self) -> Option<(AlgorithmType, usize)>
Get algorithm with highest peak memory usage
Trait Implementations§
Source§impl Clone for MemoryMetricsCollection
impl Clone for MemoryMetricsCollection
Source§fn clone(&self) -> MemoryMetricsCollection
fn clone(&self) -> MemoryMetricsCollection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MemoryMetricsCollection
impl Debug for MemoryMetricsCollection
Auto Trait Implementations§
impl Freeze for MemoryMetricsCollection
impl RefUnwindSafe for MemoryMetricsCollection
impl Send for MemoryMetricsCollection
impl Sync for MemoryMetricsCollection
impl Unpin for MemoryMetricsCollection
impl UnwindSafe for MemoryMetricsCollection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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