pub struct SessionPromotion {
pub after_failures: u32,
pub window: String,
pub probe_every: u32,
pub max_sessions: usize,
}Expand description
“After N failures within a window, promote this session’s starting rung.”
Fields§
§after_failures: u32Failure count that triggers promotion.
window: StringSliding window, e.g. "30m". Also the idle TTL: a session untouched for this long forgets
its promotion, so a reused session id never inherits a stale rung.
probe_every: u32Re-probe one rung below the promotion every probe_every turns.
Without this, promotion is a ratchet: a session that escalates once stays expensive for
its whole life, so every later turn — including the trivial ones — pays the higher rung.
The periodic probe is the only way a promotion comes back down. 1 re-probes every turn
(promotion effectively off); large values approach a permanent ratchet.
max_sessions: usizeHard cap on tracked sessions; oldest evicted first. A routing optimisation must never be able to exhaust memory on a proxy under load.
Implementations§
Source§impl SessionPromotion
impl SessionPromotion
Sourcepub fn window_duration(&self) -> Result<Duration>
pub fn window_duration(&self) -> Result<Duration>
Parse SessionPromotion::window into a Duration.
§Errors
Returns Error::BadDuration if the window is not <int><unit> with unit in s/m/h/d.
Trait Implementations§
Source§impl Clone for SessionPromotion
impl Clone for SessionPromotion
Source§fn clone(&self) -> SessionPromotion
fn clone(&self) -> SessionPromotion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more