pub struct ArchivalStats {
pub jobs_archived: u64,
pub jobs_purged: u64,
pub bytes_archived: u64,
pub bytes_purged: u64,
pub compression_ratio: f64,
pub operation_duration: Duration,
pub last_run_at: DateTime<Utc>,
}
Expand description
Statistics about archival operations.
This struct contains detailed information about the results of an archival operation, including performance metrics and compression statistics.
§Examples
use hammerwork::archive::ArchivalStats;
use chrono::Utc;
use std::time::Duration;
let stats = ArchivalStats {
jobs_archived: 150,
jobs_purged: 25,
bytes_archived: 1024 * 1024, // 1MB
bytes_purged: 500 * 1024, // 500KB
compression_ratio: 0.7, // 30% size reduction
operation_duration: Duration::from_secs(45),
last_run_at: Utc::now(),
};
assert_eq!(stats.jobs_archived, 150);
assert_eq!(stats.compression_ratio, 0.7);
assert!(stats.operation_duration.as_secs() > 0);
// Test default values
let default_stats = ArchivalStats::default();
assert_eq!(default_stats.jobs_archived, 0);
assert_eq!(default_stats.compression_ratio, 1.0);
Fields§
§jobs_archived: u64
Number of jobs archived in the last operation.
jobs_purged: u64
Number of jobs purged in the last operation.
bytes_archived: u64
Total size of data archived (in bytes).
bytes_purged: u64
Total size of data purged (in bytes).
compression_ratio: f64
Compression ratio achieved (original_size / compressed_size).
operation_duration: Duration
Time taken for the last archival operation.
last_run_at: DateTime<Utc>
Last time archival was run.
Trait Implementations§
Source§impl Clone for ArchivalStats
impl Clone for ArchivalStats
Source§fn clone(&self) -> ArchivalStats
fn clone(&self) -> ArchivalStats
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 moreSource§impl Debug for ArchivalStats
impl Debug for ArchivalStats
Source§impl Default for ArchivalStats
impl Default for ArchivalStats
Source§impl<'de> Deserialize<'de> for ArchivalStats
impl<'de> Deserialize<'de> for ArchivalStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ArchivalStats
impl RefUnwindSafe for ArchivalStats
impl Send for ArchivalStats
impl Sync for ArchivalStats
impl Unpin for ArchivalStats
impl UnwindSafe for ArchivalStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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