Skip to main content

StatsSnapshot

Struct StatsSnapshot 

Source
pub struct StatsSnapshot {
Show 16 fields pub tx_packets: u64, pub tx_bytes: u64, pub tx_dropped: u64, pub tx_errors: u64, pub rx_packets: u64, pub rx_bytes: u64, pub rx_dropped: u64, pub rx_errors: u64, pub nat_translations: u64, pub nat_fast_path_hits: u64, pub nat_slow_path_lookups: u64, pub nat_connections_created: u64, pub nat_connections_expired: u64, pub poll_iterations: u64, pub poll_work_done: u64, pub poll_busy_spins: u64,
}
Expand description

A point-in-time snapshot of datapath statistics.

Fields§

§tx_packets: u64

Total packets transmitted.

§tx_bytes: u64

Total bytes transmitted.

§tx_dropped: u64

TX packets dropped.

§tx_errors: u64

TX errors.

§rx_packets: u64

Total packets received.

§rx_bytes: u64

Total bytes received.

§rx_dropped: u64

RX packets dropped.

§rx_errors: u64

RX errors.

§nat_translations: u64

NAT translations performed.

§nat_fast_path_hits: u64

NAT fast path hits.

§nat_slow_path_lookups: u64

NAT slow path lookups.

§nat_connections_created: u64

NAT connections created.

§nat_connections_expired: u64

NAT connections expired.

§poll_iterations: u64

Poll iterations.

§poll_work_done: u64

Poll work done.

§poll_busy_spins: u64

Poll busy spins.

Implementations§

Source§

impl StatsSnapshot

Source

pub const fn total_packets(&self) -> u64

Returns the total packets (TX + RX).

Source

pub const fn total_bytes(&self) -> u64

Returns the total bytes (TX + RX).

Source

pub fn nat_hit_rate(&self) -> f64

Returns the NAT fast path hit rate (0.0 - 1.0).

Source

pub fn poll_efficiency(&self) -> f64

Returns the poll efficiency (ratio of iterations with work).

Source

pub fn delta(&self, prev: &Self) -> Self

Computes the delta between two snapshots.

Trait Implementations§

Source§

impl Clone for StatsSnapshot

Source§

fn clone(&self) -> StatsSnapshot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StatsSnapshot

Source§

impl Debug for StatsSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StatsSnapshot

Source§

fn default() -> StatsSnapshot

Returns the “default value” for a type. Read more
Source§

impl Display for StatsSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.