Struct libdata::stats::Stat []

pub struct Stat {
    pub packets: Count,
    pub size: Bytes,
    pub max_speed: Speed,
    pub speed_duration: Duration,
    pub flows: Count,
    pub flows_started: Count,
    pub start: Option<SystemTime>,
    pub end: Option<SystemTime>,
}

The flow statistics in a single direction.

This specifies the statistics (sizes, etc.) in a single direction. This refers to a single interval of the corresponding time line.

Note that this computes some derived values during serialization and omits others (eg. duration is not present, but an average speed is added).

Fields

How many packets were transferred through all the relevant flows.

How many bytes there were, including the headers.

A maximal speed of transfer.

This is the peek ‒ when we aggregate multiple smaller intervals together, this one picks the largest one of them.

The time duration of this statistics.

Used internally for speed computations when combining together.

How many flows are present in this slice.

How many flows started in this slice.

This is included in flows above.

When this flow slice started.

This is either the time the flow started (if it is in the current time slice) or the time when the time slice started.

Not present if there are no flows inside.

When this flow slice ended.

This is the opposite side than start.

Not present if there are no flows inside.

Methods

impl Stat

Is it empty?

The default (all-zeroes) value is considered empty.

Joins the stats over each other.

It assumes they happen during the same time.

Joins the stats side by side.

Unlike combine_overlay, this acts as joining them sequentially. The difference is on the speeds.

Also, this assumes self is sooner in the time than the other (eg. self happened before other).

Trait Implementations

impl Clone for Stat

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Stat

Formats the value using the given formatter.

impl Default for Stat

Returns the "default value" for a type. Read more

impl Eq for Stat

impl PartialEq for Stat

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Serialize for Stat

Serialize this value into the given Serde serializer. Read more