pub struct ProviderStats {
pub total_requests: u64,
pub successful_requests: u64,
pub failed_requests: u64,
pub average_latency_ms: f64,
pub last_used: Option<DateTime<Utc>>,
pub current_load: u32,
}Expand description
Performance statistics for a provider.
Tracks various metrics about provider performance including request counts, success rates, latency, and load information.
Fields§
§total_requests: u64Total number of requests made to this provider
successful_requests: u64Number of successful requests
failed_requests: u64Number of failed requests
average_latency_ms: f64Average response latency in milliseconds
last_used: Option<DateTime<Utc>>Timestamp of the last request to this provider
current_load: u32Current load (number of active requests)
Implementations§
Source§impl ProviderStats
impl ProviderStats
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Calculate the success rate for this provider.
Returns the percentage of successful requests as a value between 0.0 and 1.0. If no requests have been made, returns 1.0 (100% success rate).
Trait Implementations§
Source§impl Clone for ProviderStats
impl Clone for ProviderStats
Source§fn clone(&self) -> ProviderStats
fn clone(&self) -> ProviderStats
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 ProviderStats
impl Debug for ProviderStats
Source§impl Default for ProviderStats
impl Default for ProviderStats
Source§fn default() -> ProviderStats
fn default() -> ProviderStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProviderStats
impl RefUnwindSafe for ProviderStats
impl Send for ProviderStats
impl Sync for ProviderStats
impl Unpin for ProviderStats
impl UnwindSafe for ProviderStats
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