Skip to main content

immediate_probe_priority

Function immediate_probe_priority 

Source
pub(crate) fn immediate_probe_priority(
    score: f64,
    last_update: Duration,
    now: Duration,
    cfg: &ProberConfig,
) -> f64
Expand description

Computes the probing priority for an immediate neighbor edge.

Higher values mean the peer should be probed sooner. Combines:

  • Staleness: time since the edge was last measured (capped at MAX_STALENESS_SECS)
  • Inverse quality: 1.0 - score, so worse edges get higher priority
  • Base: ensures even well-measured, recently-probed peers get some chance

Peers with no edge observations receive maximum priority.