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
packets: Count
How many packets were transferred through all the relevant flows.
size: Bytes
How many bytes there were, including the headers.
max_speed: Speed
A maximal speed of transfer.
This is the peek ‒ when we aggregate multiple smaller intervals together, this one picks the largest one of them.
speed_duration: Duration
The time duration of this statistics.
Used internally for speed computations when combining together.
flows: Count
How many flows are present in this slice.
flows_started: Count
How many flows started in this slice.
This is included in flows
above.
start: Option<SystemTime>
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.
end: Option<SystemTime>
When this flow slice ended.
This is the opposite side than start
.
Not present if there are no flows inside.
Methods
impl Stat
fn is_empty(&self) -> bool
Is it empty?
The default (all-zeroes) value is considered empty.
fn combine_overlay(&mut self, other: &Self)
Joins the stats over each other.
It assumes they happen during the same time.
fn combine_seq(&mut self, other: &Self)
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
fn clone(&self) -> Stat
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Stat
impl Default for Stat
impl Eq for Stat
impl PartialEq for Stat
fn eq(&self, __arg_0: &Stat) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Stat) -> bool
This method tests for !=
.