pub struct AdaptiveConfig {
pub enabled: bool,
pub min_concurrency: usize,
pub max: ChannelMax,
pub window_ops: usize,
pub min_window_ops: usize,
pub success_target: f64,
pub timeout_ceiling: f64,
pub latency_inflation_factor: f64,
pub latency_ewma_alpha: f64,
}Expand description
Tunable knobs for the adaptive controller. Defaults are picked so that the controller behaves at least as well as the prior static defaults on a healthy network: starts at the previous static value and only deviates when signals demand it.
Fields§
§enabled: boolMaster switch. When false, channels report initial forever
and ignore observations. Useful for benchmarks / debugging.
min_concurrency: usizeFloor concurrency per channel. Never go below this.
max: ChannelMaxPer-channel ceiling concurrency. See ChannelMax.
window_ops: usizeSliding window size in number of recent ops considered for adaptation decisions.
min_window_ops: usizeBelow this count of outcomes in the window, hold steady.
success_target: f64Required success rate to consider the window healthy. Healthy windows trigger increase; unhealthy windows trigger decrease.
timeout_ceiling: f64Timeout rate above which the window counts as stressed even if the success rate would otherwise pass.
latency_inflation_factor: f64p95 latency above latency_inflation_factor * baseline is a
stress signal. Baseline is an EWMA of healthy-window p95s.
latency_ewma_alpha: f64EWMA smoothing factor for the latency baseline. 0 = never
updates, 1 = baseline = last sample. 0.2 trades responsiveness
for stability. Validated to [0.0, 1.0]; NaN/non-finite
values are sanitized to the default at controller construction.
Implementations§
Trait Implementations§
Source§impl Clone for AdaptiveConfig
impl Clone for AdaptiveConfig
Source§fn clone(&self) -> AdaptiveConfig
fn clone(&self) -> AdaptiveConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AdaptiveConfig
impl Debug for AdaptiveConfig
Source§impl Default for AdaptiveConfig
impl Default for AdaptiveConfig
Source§impl<'de> Deserialize<'de> for AdaptiveConfig
impl<'de> Deserialize<'de> for AdaptiveConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AdaptiveConfig
impl RefUnwindSafe for AdaptiveConfig
impl Send for AdaptiveConfig
impl Sync for AdaptiveConfig
impl Unpin for AdaptiveConfig
impl UnsafeUnpin for AdaptiveConfig
impl UnwindSafe for AdaptiveConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more