pub struct NetworkMetrics {
pub interface: String,
pub mac_address: Option<String>,
pub driver: Option<String>,
pub operstate: Option<String>,
pub speed_mbps: Option<i64>,
pub mtu: Option<u32>,
pub rx_bytes_per_sec: f64,
pub tx_bytes_per_sec: f64,
pub rx_bytes_total: u64,
pub tx_bytes_total: u64,
}Expand description
Per-interface metrics: static identity (cached once) + dynamic throughput and link state (polled each interval).
Fields§
§interface: String§mac_address: Option<String>MAC address, e.g. “00:11:22:33:44:55”.
driver: Option<String>Kernel driver name, e.g. “igc”, “virtio_net”.
operstate: Option<String>“up”, “down”, “unknown”, etc. from /sys/class/net/<iface>/operstate.
speed_mbps: Option<i64>Link speed in Mbps. -1 when the driver does not report it.
mtu: Option<u32>MTU in bytes.
rx_bytes_per_sec: f64§tx_bytes_per_sec: f64§rx_bytes_total: u64Cumulative bytes received since boot (raw /proc/net/dev counter).
Matches Python resource-tracker’s net_recv_bytes column.
tx_bytes_total: u64Cumulative bytes sent since boot (raw /proc/net/dev counter).
Matches Python resource-tracker’s net_sent_bytes column.
Trait Implementations§
Source§impl Clone for NetworkMetrics
impl Clone for NetworkMetrics
Source§fn clone(&self) -> NetworkMetrics
fn clone(&self) -> NetworkMetrics
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 NetworkMetrics
impl Debug for NetworkMetrics
Source§impl<'de> Deserialize<'de> for NetworkMetrics
impl<'de> Deserialize<'de> for NetworkMetrics
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 NetworkMetrics
impl RefUnwindSafe for NetworkMetrics
impl Send for NetworkMetrics
impl Sync for NetworkMetrics
impl Unpin for NetworkMetrics
impl UnsafeUnpin for NetworkMetrics
impl UnwindSafe for NetworkMetrics
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