pub struct ErrorBudget { /* private fields */ }Expand description
错误预算(Error Budget),基于 SLO 目标和滑动时间窗口。
核心模型:每个错误消耗 (1 - slo_target) 单位的预算,预算容量为 1.0。
因此预算耗尽所需的错误数 = 1 / (1 - slo_target)(例如 SLO=0.999 时为 1000 个错误)。
该模型假设窗口内基线流量为 1/(1-SLO) 个请求;这是金融级 SLA 监控中
常用的简化模型,适用于独立于流量统计的错误预算追踪。
窗口外的 consume 调用会在下一次记录时被驱逐。
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