pub struct SimulatorStats {
pub packets_processed: u64,
pub packets_dropped: u64,
pub packets_delayed: u64,
pub packets_reordered: u64,
pub bytes_processed: u64,
pub avg_latency_ms: f64,
pub max_latency_ms: u64,
pub latency_spikes: u64,
pub start_time: Option<Instant>,
pub duration: Duration,
}Expand description
Statistics tracked by the simulator
Fields§
§packets_processed: u64Total packets processed
packets_dropped: u64Packets dropped due to loss simulation
packets_delayed: u64Packets delayed
packets_reordered: u64Packets reordered
bytes_processed: u64Total bytes processed
avg_latency_ms: f64Average latency in milliseconds
max_latency_ms: u64Maximum latency observed in milliseconds
latency_spikes: u64Number of latency spikes
start_time: Option<Instant>Simulation start time
duration: DurationSimulation duration
Implementations§
Source§impl SimulatorStats
impl SimulatorStats
Sourcepub fn packet_loss_rate(&self) -> f64
pub fn packet_loss_rate(&self) -> f64
Calculate packet loss rate
Sourcepub fn throughput_bps(&self) -> f64
pub fn throughput_bps(&self) -> f64
Calculate throughput in bytes per second
Trait Implementations§
Source§impl Clone for SimulatorStats
impl Clone for SimulatorStats
Source§fn clone(&self) -> SimulatorStats
fn clone(&self) -> SimulatorStats
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 SimulatorStats
impl Debug for SimulatorStats
Source§impl Default for SimulatorStats
impl Default for SimulatorStats
Source§fn default() -> SimulatorStats
fn default() -> SimulatorStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimulatorStats
impl RefUnwindSafe for SimulatorStats
impl Send for SimulatorStats
impl Sync for SimulatorStats
impl Unpin for SimulatorStats
impl UnwindSafe for SimulatorStats
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more