pub struct OperationStats {
pub count: u64,
pub total_us: u64,
pub min_us: u64,
pub max_us: u64,
pub last_us: u64,
pub histogram: Vec<u64>,
pub sum_of_squares: f64,
}Expand description
Statistics for a single operation type.
Fields§
§count: u64§total_us: u64§min_us: u64§max_us: u64§last_us: u64§histogram: Vec<u64>Histogram buckets for percentile calculation (microseconds)
sum_of_squares: f64Sum of squares for variance calculation
Implementations§
Source§impl OperationStats
impl OperationStats
Sourcepub fn ops_per_sec(&self) -> f64
pub fn ops_per_sec(&self) -> f64
Calculate operations per second (estimate based on total time).
Sourcepub fn std_dev_us(&self) -> f64
pub fn std_dev_us(&self) -> f64
Calculate standard deviation.
Sourcepub fn percentile(&self, p: f64) -> u64
pub fn percentile(&self, p: f64) -> u64
Calculate percentile from histogram (requires sorted data).
Sourcepub fn count_below(&self, threshold_us: u64) -> u64
pub fn count_below(&self, threshold_us: u64) -> u64
Count samples below threshold (for Prometheus histogram buckets).
Trait Implementations§
Source§impl Clone for OperationStats
impl Clone for OperationStats
Source§fn clone(&self) -> OperationStats
fn clone(&self) -> OperationStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OperationStats
impl RefUnwindSafe for OperationStats
impl Send for OperationStats
impl Sync for OperationStats
impl Unpin for OperationStats
impl UnwindSafe for OperationStats
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