pub struct ArrivalGroupAccumulator { /* private fields */ }Expand description
Collects acknowledgements into bursts and emits the gradient between consecutive bursts.
§Difference from upstream
Upstream’s accumulator emits a group only when the next group begins, so the final group is
never emitted (arrival_group_accumulator.go:26-67). Live that is invisible; in a test that
ends, the last measurement silently disappears. Here flush exists so a test can
close the stream, and the live path is unchanged.
Implementations§
Source§impl ArrivalGroupAccumulator
impl ArrivalGroupAccumulator
Sourcepub fn new(burst_interval: Duration) -> Self
pub fn new(burst_interval: Duration) -> Self
An accumulator grouping packets sent within burst_interval of each other.
Sourcepub fn accumulate(&mut self, report: &PacketReport) -> Option<InterGroupDelay>
pub fn accumulate(&mut self, report: &PacketReport) -> Option<InterGroupDelay>
Feed one report. Returns a gradient when this report started a new group.
Reports that did not arrive carry no timing and are skipped — loss is the loss controller’s signal, not the delay controller’s.
Sourcepub fn flush(&mut self) -> Option<InterGroupDelay>
pub fn flush(&mut self) -> Option<InterGroupDelay>
Close the stream, emitting the gradient for the group still open.
Upstream has no equivalent and therefore drops its last group. Live that does not matter; for a test with a definite end it is the difference between measuring what happened and measuring all but the last of it.
Trait Implementations§
Source§impl Clone for ArrivalGroupAccumulator
impl Clone for ArrivalGroupAccumulator
Source§fn clone(&self) -> ArrivalGroupAccumulator
fn clone(&self) -> ArrivalGroupAccumulator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more