pub struct ErrorBudget { /* private fields */ }Expand description
Error budget, based on the SLO target and a sliding time window.
Core model: each error consumes (1 - slo_target) units of budget, and the budget
capacity is 1.0. Therefore the number of errors required to exhaust the budget is
1 / (1 - slo_target) (e.g., 1000 errors when SLO=0.999). This model assumes the
baseline traffic within the window is 1/(1-SLO) requests; it is a simplified model
commonly used in financial-grade SLA monitoring, suitable for error budget tracking
independent of traffic statistics.
consume calls outside the window are evicted on the next record.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorBudget
impl RefUnwindSafe for ErrorBudget
impl Send for ErrorBudget
impl Sync for ErrorBudget
impl Unpin for ErrorBudget
impl UnsafeUnpin for ErrorBudget
impl UnwindSafe for ErrorBudget
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 more