pub struct CompressionStatistics {
pub original_size: u64,
pub compressed_size: u64,
pub compression_ratio: f64,
pub compression_time: u64,
pub decompression_time: u64,
pub compression_count: u64,
pub decompression_count: u64,
}Expand description
Compression statistics
Tracks cumulative metrics across all compression/decompression operations
performed by a DataCompressionEngine. The compression_ratio field
records the ratio of the most recent compression operation, while
CompressionStatistics::compression_ratio computes the overall ratio
from the cumulative byte totals.
Fields§
§original_size: u64Total original (uncompressed) bytes processed across all compress ops.
compressed_size: u64Total compressed bytes produced across all compress ops.
compression_ratio: f64Ratio of the most recent compression operation (compressed / original).
compression_time: u64Total time spent compressing, in nanoseconds.
decompression_time: u64Total time spent decompressing, in nanoseconds.
compression_count: u64Number of compression operations performed.
decompression_count: u64Number of decompression operations performed.
Implementations§
Source§impl CompressionStatistics
impl CompressionStatistics
Sourcepub fn record_compression(
&mut self,
original: u64,
compressed: u64,
elapsed_ns: u64,
)
pub fn record_compression( &mut self, original: u64, compressed: u64, elapsed_ns: u64, )
Record a single compression operation.
Sourcepub fn record_decompression(&mut self, elapsed_ns: u64)
pub fn record_decompression(&mut self, elapsed_ns: u64)
Record a single decompression operation.
Sourcepub fn compression_ratio(&self) -> f64
pub fn compression_ratio(&self) -> f64
Overall compression ratio across all operations
(compressed_size / original_size). Returns 0.0 when no data has been
compressed yet.
Trait Implementations§
Source§impl Clone for CompressionStatistics
impl Clone for CompressionStatistics
Source§fn clone(&self) -> CompressionStatistics
fn clone(&self) -> CompressionStatistics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CompressionStatistics
impl RefUnwindSafe for CompressionStatistics
impl Send for CompressionStatistics
impl Sync for CompressionStatistics
impl Unpin for CompressionStatistics
impl UnsafeUnpin for CompressionStatistics
impl UnwindSafe for CompressionStatistics
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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