pub struct PerformanceMonitor { /* private fields */ }
Expand description
Performance monitor for tracking operations and system metrics
Implementations§
Source§impl PerformanceMonitor
impl PerformanceMonitor
Sourcepub fn new_default() -> Self
pub fn new_default() -> Self
Create a new performance monitor with default settings
Sourcepub fn start_operation(&self, operation_name: &str) -> OperationTimer
pub fn start_operation(&self, operation_name: &str) -> OperationTimer
Start timing an operation
Sourcepub fn record_operation(&self, metric: &OperationMetrics)
pub fn record_operation(&self, metric: &OperationMetrics)
Record a completed operation
Sourcepub fn get_metrics(&self) -> Vec<OperationMetrics>
pub fn get_metrics(&self) -> Vec<OperationMetrics>
Get all operation metrics
Sourcepub fn get_all_stats(&self) -> HashMap<String, PerformanceStats>
pub fn get_all_stats(&self) -> HashMap<String, PerformanceStats>
Get aggregated statistics for all operations
Sourcepub fn get_operation_stats(
&self,
operation_name: &str,
) -> Option<PerformanceStats>
pub fn get_operation_stats( &self, operation_name: &str, ) -> Option<PerformanceStats>
Get statistics for a specific operation
Sourcepub fn get_system_metrics(&self) -> Result<SystemMetrics>
pub fn get_system_metrics(&self) -> Result<SystemMetrics>
Get current system metrics Get system metrics
§Errors
Returns an error if system information cannot be retrieved.
Sourcepub fn get_summary(&self) -> PerformanceSummary
pub fn get_summary(&self) -> PerformanceSummary
Get performance summary
Sourcepub fn record_cache_metrics(&self, cache_type: &str, metrics: CacheMetrics)
pub fn record_cache_metrics(&self, cache_type: &str, metrics: CacheMetrics)
Record cache metrics
Sourcepub fn get_cache_metrics(&self, cache_type: &str) -> Option<CacheMetrics>
pub fn get_cache_metrics(&self, cache_type: &str) -> Option<CacheMetrics>
Get cache metrics for a specific cache type
Sourcepub fn get_all_cache_metrics(&self) -> HashMap<String, CacheMetrics>
pub fn get_all_cache_metrics(&self) -> HashMap<String, CacheMetrics>
Get all cache metrics
Sourcepub fn record_query_metrics(&self, query_type: &str, metrics: QueryMetrics)
pub fn record_query_metrics(&self, query_type: &str, metrics: QueryMetrics)
Record query metrics
Sourcepub fn get_query_metrics(&self, query_type: &str) -> Option<QueryMetrics>
pub fn get_query_metrics(&self, query_type: &str) -> Option<QueryMetrics>
Get query metrics for a specific query type
Sourcepub fn get_all_query_metrics(&self) -> HashMap<String, QueryMetrics>
pub fn get_all_query_metrics(&self) -> HashMap<String, QueryMetrics>
Get all query metrics
Sourcepub fn get_comprehensive_summary(&self) -> ComprehensivePerformanceSummary
pub fn get_comprehensive_summary(&self) -> ComprehensivePerformanceSummary
Get comprehensive performance summary including cache and query 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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