#[non_exhaustive]pub struct InterfaceMonitor {
pub interface_id: InterfaceId,
pub counters: TrafficCounters,
pub latency_samples: Vec<LatencySample>,
pub max_samples: usize,
pub started_at: DateTime,
}Expand description
Per-interface traffic monitor.
Tier: T2-C (N + ν + σ — quantified periodic measurement sequence)
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.interface_id: InterfaceIdInterface being monitored.
counters: TrafficCountersTraffic counters.
latency_samples: Vec<LatencySample>Recent latency samples (ring buffer, newest last).
max_samples: usizeMaximum latency samples to keep.
started_at: DateTimeWhen monitoring started.
Implementations§
Source§impl InterfaceMonitor
impl InterfaceMonitor
Sourcepub fn new(interface_id: InterfaceId) -> Self
pub fn new(interface_id: InterfaceId) -> Self
Create a new monitor for an interface.
Sourcepub fn record_latency(&mut self, rtt_us: u64)
pub fn record_latency(&mut self, rtt_us: u64)
Record a latency measurement.
Sourcepub fn avg_latency_us(&self) -> Option<u64>
pub fn avg_latency_us(&self) -> Option<u64>
Average latency in microseconds.
Sourcepub fn avg_latency_ms(&self) -> Option<u64>
pub fn avg_latency_ms(&self) -> Option<u64>
Average latency in milliseconds.
Sourcepub fn min_latency_us(&self) -> Option<u64>
pub fn min_latency_us(&self) -> Option<u64>
Min latency in microseconds.
Sourcepub fn max_latency_us(&self) -> Option<u64>
pub fn max_latency_us(&self) -> Option<u64>
Max latency in microseconds.
Sourcepub fn quality(&self) -> ConnectionQuality
pub fn quality(&self) -> ConnectionQuality
Current connection quality assessment.
Trait Implementations§
Source§impl Clone for InterfaceMonitor
impl Clone for InterfaceMonitor
Source§fn clone(&self) -> InterfaceMonitor
fn clone(&self) -> InterfaceMonitor
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 InterfaceMonitor
impl Debug for InterfaceMonitor
Source§impl<'de> Deserialize<'de> for InterfaceMonitor
impl<'de> Deserialize<'de> for InterfaceMonitor
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 InterfaceMonitor
impl RefUnwindSafe for InterfaceMonitor
impl Send for InterfaceMonitor
impl Sync for InterfaceMonitor
impl Unpin for InterfaceMonitor
impl UnsafeUnpin for InterfaceMonitor
impl UnwindSafe for InterfaceMonitor
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