pub struct MetricsSnapshot {
pub packets_sent: u64,
pub packets_received: u64,
pub bytes_sent: u64,
pub bytes_received: u64,
pub errors: u64,
pub uptime: Duration,
}Expand description
Snapshot of metrics at a point in time
Fields§
§packets_sent: u64§packets_received: u64§bytes_sent: u64§bytes_received: u64§errors: u64§uptime: DurationImplementations§
Source§impl MetricsSnapshot
impl MetricsSnapshot
Sourcepub fn packets_per_second(&self) -> f64
pub fn packets_per_second(&self) -> f64
Calculate packets per second
Sourcepub fn bytes_per_second(&self) -> f64
pub fn bytes_per_second(&self) -> f64
Calculate bytes per second
Sourcepub fn error_rate(&self) -> f64
pub fn error_rate(&self) -> f64
Calculate error rate
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 moreAuto Trait Implementations§
impl Freeze for MetricsSnapshot
impl RefUnwindSafe for MetricsSnapshot
impl Send for MetricsSnapshot
impl Sync for MetricsSnapshot
impl Unpin for MetricsSnapshot
impl UnsafeUnpin 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