pub struct PerformanceMonitor { /* private fields */ }Expand description
Performance Monitor
Provides comprehensive monitoring, metrics collection, and benchmarking for the intelligent cache system.
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
Sourcepub fn new(config: MonitoringConfig) -> Self
pub fn new(config: MonitoringConfig) -> Self
Create a new performance monitor
Sourcepub async fn record_get_latency(&self, latency: Duration)
pub async fn record_get_latency(&self, latency: Duration)
Record a get operation latency
Sourcepub async fn record_put_latency(&self, latency: Duration)
pub async fn record_put_latency(&self, latency: Duration)
Record a put operation latency
Sourcepub async fn record_remove_latency(&self, latency: Duration)
pub async fn record_remove_latency(&self, latency: Duration)
Record a remove operation latency
Sourcepub async fn update_memory_usage(&self, current_usage: u64)
pub async fn update_memory_usage(&self, current_usage: u64)
Update memory usage
Sourcepub async fn record_disk_io(&self, bytes_read: u64, bytes_written: u64)
pub async fn record_disk_io(&self, bytes_read: u64, bytes_written: u64)
Record disk I/O
Sourcepub async fn get_performance_metrics(&self) -> PerformanceMetrics
pub async fn get_performance_metrics(&self) -> PerformanceMetrics
Get current performance metrics
Sourcepub async fn run_benchmark<F, Fut>(
&self,
name: &str,
benchmark_fn: F,
) -> BenchmarkResult
pub async fn run_benchmark<F, Fut>( &self, name: &str, benchmark_fn: F, ) -> BenchmarkResult
Run a benchmark
Sourcepub async fn get_recent_events(&self, limit: usize) -> Vec<PerformanceEvent>
pub async fn get_recent_events(&self, limit: usize) -> Vec<PerformanceEvent>
Get recent performance events
Sourcepub async fn get_benchmark_history(&self) -> Vec<BenchmarkResult>
pub async fn get_benchmark_history(&self) -> Vec<BenchmarkResult>
Get benchmark history
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