pub struct OperationStatistics {
pub operation: String,
pub count: usize,
pub total_time: Duration,
pub min_time: Duration,
pub max_time: Duration,
pub avg_memory: f64,
pub time_std_dev: f64,
pub memory_stats: MemoryStatistics,
pub custom_metrics: HashMap<String, MetricStatistics>,
}Expand description
Detailed statistics for a specific operation type
This struct aggregates multiple performance measurements for a single operation type to provide comprehensive statistical analysis including timing, memory usage, and performance trends.
Fields§
§operation: StringOperation name identifier
count: usizeTotal number of measurements
total_time: DurationTotal execution time across all measurements
min_time: DurationMinimum execution time observed
max_time: DurationMaximum execution time observed
avg_memory: f64Average memory usage across measurements
time_std_dev: f64Standard deviation of execution times
memory_stats: MemoryStatisticsMemory usage statistics
custom_metrics: HashMap<String, MetricStatistics>Custom operation metrics
Implementations§
Source§impl OperationStatistics
impl OperationStatistics
Sourcepub fn add_measurement(&mut self, measurement: &PerformanceMeasurement)
pub fn add_measurement(&mut self, measurement: &PerformanceMeasurement)
Add a measurement to these statistics
Sourcepub fn operations_per_second(&self) -> f64
pub fn operations_per_second(&self) -> f64
Get operations per second
Sourcepub fn timing_consistency(&self) -> f64
pub fn timing_consistency(&self) -> f64
Get coefficient of variation for timing (std_dev / mean)
Sourcepub fn is_consistent(&self) -> bool
pub fn is_consistent(&self) -> bool
Check if performance is consistent (low coefficient of variation)
Sourcepub fn memory_efficiency(&self) -> f64
pub fn memory_efficiency(&self) -> f64
Get memory efficiency score (0-1, higher is better)
Trait Implementations§
Source§impl Clone for OperationStatistics
impl Clone for OperationStatistics
Auto Trait Implementations§
impl Freeze for OperationStatistics
impl RefUnwindSafe for OperationStatistics
impl Send for OperationStatistics
impl Sync for OperationStatistics
impl Unpin for OperationStatistics
impl UnsafeUnpin for OperationStatistics
impl UnwindSafe for OperationStatistics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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