Skip to main content

RateMetric

Trait RateMetric 

Source
pub trait RateMetric: Send + Sync {
    // Required method
    fn remaining_ratio(&self) -> f64;
}
Expand description

Exposes remaining capacity for quota-aware strategies. Higher is better.

Complementary to LoadMetric (which exposes current load — lower is better):

  • LoadMetric: “how busy is this node?” → lower wins
  • RateMetric: “how much capacity remains?” → higher wins

A node can implement both — a node may have low load but little remaining quota, or high load but ample quota.

Required Methods§

Source

fn remaining_ratio(&self) -> f64

Remaining capacity as a ratio: 0.0 = exhausted, 1.0 = fully available.

Implementors§