Skip to main content

Observable

Trait Observable 

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§

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

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

fn last_update(&self) -> Duration

The timestamp of the last update.

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

Return average latency observed for the measured peer.

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.

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.

Implementations on Foreign Types§

§

impl Observable for Observations

§

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

Implementors§