pub struct PerformanceTracker<T = f32> { /* private fields */ }Expand description
Tracks performance metrics over time to identify trends
Implementations§
Source§impl<T> PerformanceTracker<T>
impl<T> PerformanceTracker<T>
Sourcepub fn record_metrics(&mut self, metrics: ResourceMetrics<T>)where
T: Clone + FromPrimitive,
pub fn record_metrics(&mut self, metrics: ResourceMetrics<T>)where
T: Clone + FromPrimitive,
Record a new set of metrics
Sourcepub fn record_indicator(
&mut self,
name: &str,
timestamp: Timestamp<u64>,
value: T,
)
pub fn record_indicator( &mut self, name: &str, timestamp: Timestamp<u64>, value: T, )
Record an individual indicator
Sourcepub fn record_event(&mut self, event: &str, value: Option<T>)
pub fn record_event(&mut self, event: &str, value: Option<T>)
Record a significant performance event
Sourcepub fn get_indicator_history(
&self,
indicator: &str,
) -> Option<&VecDeque<(Timestamp<u64>, T)>>
pub fn get_indicator_history( &self, indicator: &str, ) -> Option<&VecDeque<(Timestamp<u64>, T)>>
Get the full history of an indicator
Sourcepub fn latest_metrics(&self) -> Option<&ResourceMetrics<T>>
pub fn latest_metrics(&self) -> Option<&ResourceMetrics<T>>
Get the most recent metrics
Sourcepub fn recent_events(
&self,
count: usize,
) -> Vec<(Timestamp<u64>, String, Option<T>)>where
T: Clone,
pub fn recent_events(
&self,
count: usize,
) -> Vec<(Timestamp<u64>, String, Option<T>)>where
T: Clone,
Get recent performance events
Sourcepub fn generate_trend_report(&self) -> String
pub fn generate_trend_report(&self) -> String
Generate a performance trend report