pub struct CanaryAnalysis {
pub enabled: bool,
pub window_seconds: u64,
pub step: u32,
pub min_requests: u64,
pub cooldown_seconds: u64,
pub promote: CanaryRule,
pub rollback: CanaryRule,
}Expand description
Auto-canary analysis (DW-091): metrics-driven promotion/rollback of canary split weights. A background controller compares the canary side against the baseline on error rate or latency; on regression it rolls the canary weight back (toward 0), on success it promotes (toward the total weight). Severe regression (>2x the rollback threshold) triggers an immediate rollback to 0. The total weight stays constant: when the canary weight changes, the baseline absorbs the difference, preserving the hash distribution for existing sessions (the DW-040 invariant). Weight changes are TRANSIENT (a Generation swap) and revert on config reload.
Fields§
§enabled: boolMaster switch. Default true: an analysis block is active unless explicitly disabled.
window_seconds: u64Look-back window for metrics, in seconds. The controller evaluates canary health over the recent window of observations.
step: u32Weight delta per adjustment (in weight units). Promote:
increase canary weight by step. Rollback: decrease by step.
Severe regression (>2x the rollback threshold) rolls back to 0
immediately, ignoring the step.
min_requests: u64Minimum total requests (baseline + canary) before the controller acts. Prevents acting on insufficient data.
cooldown_seconds: u64Cooldown between adjustments, in seconds. Prevents rapid oscillation: after one adjustment, the next is suppressed until the cooldown elapses.
promote: CanaryRuleThe promotion rule: when the canary metric is BELOW this
threshold (good), the controller promotes (increases canary
weight by step).
rollback: CanaryRuleThe rollback rule: when the canary metric is ABOVE this
threshold (bad), the controller rolls back (decreases canary
weight by step). When the canary metric exceeds 2x this
threshold (severe regression), the controller rolls back to 0
immediately.
Trait Implementations§
Source§impl Clone for CanaryAnalysis
impl Clone for CanaryAnalysis
Source§fn clone(&self) -> CanaryAnalysis
fn clone(&self) -> CanaryAnalysis
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CanaryAnalysis
impl Debug for CanaryAnalysis
Source§impl<'de> Deserialize<'de> for CanaryAnalysis
impl<'de> Deserialize<'de> for CanaryAnalysis
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>,
Source§impl JsonSchema for CanaryAnalysis
impl JsonSchema for CanaryAnalysis
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for CanaryAnalysis
impl PartialEq for CanaryAnalysis
Source§impl Serialize for CanaryAnalysis
impl Serialize for CanaryAnalysis
impl StructuralPartialEq for CanaryAnalysis
Auto Trait Implementations§
impl Freeze for CanaryAnalysis
impl RefUnwindSafe for CanaryAnalysis
impl Send for CanaryAnalysis
impl Sync for CanaryAnalysis
impl Unpin for CanaryAnalysis
impl UnwindSafe for CanaryAnalysis
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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