pub struct ArrivalForecast { /* private fields */ }Expand description
Receiver-side Sprout-style rate forecaster.
Implementations§
Source§impl ArrivalForecast
impl ArrivalForecast
pub fn new() -> Self
Sourcepub fn observe(&mut self, bytes: u64, interval_s: f64)
pub fn observe(&mut self, bytes: u64, interval_s: f64)
Feed one measurement: bytes delivered over interval_s seconds. The
first observation seeds the filter; later ones run the Kalman
predict / update with rate-scaled process and measurement noise.
Sourcepub fn forecast_bps(&self) -> f64
pub fn forecast_bps(&self) -> f64
The forecast: the 5th-percentile deliverable rate over the next tick
(bytes/s), mean - 1.645 * sqrt(var + process noise), floored at zero.
A conservative lower bound the sender can size to without overshooting.
Trait Implementations§
Source§impl Clone for ArrivalForecast
impl Clone for ArrivalForecast
Source§fn clone(&self) -> ArrivalForecast
fn clone(&self) -> ArrivalForecast
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ArrivalForecast
impl Debug for ArrivalForecast
Auto Trait Implementations§
impl Freeze for ArrivalForecast
impl RefUnwindSafe for ArrivalForecast
impl Send for ArrivalForecast
impl Sync for ArrivalForecast
impl Unpin for ArrivalForecast
impl UnsafeUnpin for ArrivalForecast
impl UnwindSafe for ArrivalForecast
Blanket Implementations§
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