pub struct FetchStatsSnapshot {
pub total: u64,
pub success: u64,
pub unavailable: u64,
pub unreachable: u64,
pub protected: u64,
pub conditional_hits: u64,
pub bytes_fetched: u64,
pub fetch_time_ms: u64,
pub min_fetch_time_ms: u64,
pub max_fetch_time_ms: u64,
}Expand description
Snapshot of fetch statistics
Fields§
§total: u64Total fetches
success: u64Successful fetches
Unavailable (4xx)
unreachable: u64Unreachable (5xx/network)
protected: u64Protected (401/403)
conditional_hits: u64Conditional GET hits (304)
bytes_fetched: u64Total bytes
fetch_time_ms: u64Total time
min_fetch_time_ms: u64Minimum fetch time
max_fetch_time_ms: u64Maximum fetch time
Implementations§
Source§impl FetchStatsSnapshot
impl FetchStatsSnapshot
Sourcepub fn avg_fetch_time_ms(&self) -> f64
pub fn avg_fetch_time_ms(&self) -> f64
Calculate average fetch time in milliseconds
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Calculate success rate (0.0 - 1.0)
Sourcepub fn conditional_hit_rate(&self) -> f64
pub fn conditional_hit_rate(&self) -> f64
Calculate conditional hit rate (bandwidth savings)
Trait Implementations§
Source§impl Clone for FetchStatsSnapshot
impl Clone for FetchStatsSnapshot
Source§fn clone(&self) -> FetchStatsSnapshot
fn clone(&self) -> FetchStatsSnapshot
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 FetchStatsSnapshot
impl RefUnwindSafe for FetchStatsSnapshot
impl Send for FetchStatsSnapshot
impl Sync for FetchStatsSnapshot
impl Unpin for FetchStatsSnapshot
impl UnwindSafe for FetchStatsSnapshot
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