pub struct Metrics {
pub total_operations: u64,
pub total_bytes_in: u64,
pub total_bytes_out: u64,
pub total_time_us: u64,
pub error_count: u64,
}Expand description
Metrics collector for aggregate statistics.
Fields§
§total_operations: u64Total operations performed.
total_bytes_in: u64Total bytes compressed.
total_bytes_out: u64Total bytes produced.
total_time_us: u64Total time spent in microseconds.
error_count: u64Number of errors encountered.
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn record(&mut self, stats: &CompressionStats)
pub fn record(&mut self, stats: &CompressionStats)
Record a completed operation.
Sourcepub fn record_error(&mut self)
pub fn record_error(&mut self)
Record an error.
Sourcepub fn average_ratio(&self) -> f64
pub fn average_ratio(&self) -> f64
Get average compression ratio.
Sourcepub fn average_throughput_mbs(&self) -> f64
pub fn average_throughput_mbs(&self) -> f64
Get average throughput in MB/s.
Sourcepub fn error_rate(&self) -> f64
pub fn error_rate(&self) -> f64
Get error rate (0.0 to 1.0).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
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