pub struct MetricsSnapshot {Show 14 fields
pub total_logs: u64,
pub logs_by_level: HashMap<String, u64>,
pub logs_by_category: HashMap<String, u64>,
pub bytes_logged: u64,
pub errors_count: u64,
pub rate_limited_count: u64,
pub redacted_count: u64,
pub encrypted_count: u64,
pub uptime_seconds: u64,
pub average_rate: f64,
pub peak_rate: u64,
pub current_rate: u64,
pub last_log_time: Option<DateTime<Utc>>,
pub snapshot_time: DateTime<Utc>,
}Expand description
Snapshot of metrics at a point in time
Fields§
§total_logs: u64§logs_by_level: HashMap<String, u64>§logs_by_category: HashMap<String, u64>§bytes_logged: u64§errors_count: u64§rate_limited_count: u64§redacted_count: u64§encrypted_count: u64§uptime_seconds: u64§average_rate: f64§peak_rate: u64§current_rate: u64§last_log_time: Option<DateTime<Utc>>§snapshot_time: DateTime<Utc>Implementations§
Source§impl MetricsSnapshot
impl MetricsSnapshot
Sourcepub fn bytes_human_readable(&self) -> String
pub fn bytes_human_readable(&self) -> String
Get bytes logged in human-readable format
Sourcepub fn error_percentage(&self) -> f64
pub fn error_percentage(&self) -> f64
Get percentage of errors
Sourcepub fn redaction_percentage(&self) -> f64
pub fn redaction_percentage(&self) -> f64
Get percentage of redacted logs
Trait Implementations§
Source§impl Clone for MetricsSnapshot
impl Clone for MetricsSnapshot
Source§fn clone(&self) -> MetricsSnapshot
fn clone(&self) -> MetricsSnapshot
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 MetricsSnapshot
impl Debug for MetricsSnapshot
Source§impl<'de> Deserialize<'de> for MetricsSnapshot
impl<'de> Deserialize<'de> for MetricsSnapshot
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 MetricsSnapshot
impl RefUnwindSafe for MetricsSnapshot
impl Send for MetricsSnapshot
impl Sync for MetricsSnapshot
impl Unpin for MetricsSnapshot
impl UnwindSafe for MetricsSnapshot
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