pub struct GateHealthRegistry { /* private fields */ }Expand description
Per-(tenant, gate) error budgets for a running proxy (app-level, shared across requests;
ADR 0004 §D6). Budgets (window + max abstain fraction) are registered per gate id at startup;
the actual rolling-window accounting is a separate GateHealth per (tenant, gate) pair, so
one tenant tripping a gate’s budget auto-disables it only for that tenant, not globally. With
auth off every request carries the tenant id "default", so there is exactly one bucket per
gate and behavior is unchanged from the pre-D6 global registry.
Unregistered gates default to enabled with no accounting (a gate the operator didn’t register a budget for is simply never auto-disabled).
Implementations§
Source§impl GateHealthRegistry
impl GateHealthRegistry
Sourcepub fn with_budget(
self,
gate_id: impl Into<String>,
window: usize,
max_error_rate: f64,
) -> Self
pub fn with_budget( self, gate_id: impl Into<String>, window: usize, max_error_rate: f64, ) -> Self
Register an error budget for gate_id (window size + max abstain fraction).
Trait Implementations§
Source§impl Debug for GateHealthRegistry
impl Debug for GateHealthRegistry
Source§impl Default for GateHealthRegistry
impl Default for GateHealthRegistry
Source§fn default() -> GateHealthRegistry
fn default() -> GateHealthRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for GateHealthRegistry
impl RefUnwindSafe for GateHealthRegistry
impl Send for GateHealthRegistry
impl Sync for GateHealthRegistry
impl Unpin for GateHealthRegistry
impl UnsafeUnpin for GateHealthRegistry
impl UnwindSafe for GateHealthRegistry
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.