Struct ipfs_embed::Rtt
source · pub struct Rtt { /* private fields */ }
Implementations§
source§impl Rtt
impl Rtt
pub fn new(current: Duration) -> Self
pub fn register(&mut self, current: Duration)
pub fn register_failure(&mut self)
sourcepub fn decay_3(&self) -> Duration
pub fn decay_3(&self) -> Duration
Get the rtt’s exponentially weighted moving average
Decay parameter is 30%.
sourcepub fn decay_10(&self) -> Duration
pub fn decay_10(&self) -> Duration
Get the rtt’s exponentially weighted moving average
Decay parameter is 10%.
sourcepub fn failure_rate(&self) -> u32
pub fn failure_rate(&self) -> u32
Get the rtt’s exponentially weighted moving average of the failure rate
Decay parameter is 1% and the returned value is rate * 1e6.