Observable

Trait Observable 

Source
pub trait Observable {
    // Required methods
    fn record_probe(&mut self, latency: Result<Duration, ()>);
    fn last_update(&self) -> Duration;
    fn average_latency(&self) -> Option<Duration>;
    fn average_probe_rate(&self) -> f64;
    fn score(&self) -> f64;
}

Required Methods§

Source

fn record_probe(&mut self, latency: Result<Duration, ()>)

Record a new result of the probe towards the measured peer.

Source

fn last_update(&self) -> Duration

The timestamp of the last update.

Source

fn average_latency(&self) -> Option<Duration>

Return average latency observed for the measured peer.

Source

fn average_probe_rate(&self) -> f64

A value representing the average success rate of probes.

It is from the range [0.0, 1.0]. The higher the value, the better the score.

Source

fn score(&self) -> f64

A value scoring the observed peer.

It is from the range [0.0, 1.0]. The higher the value, the better the score.

Implementors§