pub struct State {
since: Option<i64>,
firing: Option<i64>,
value: f64,
matched: usize,
total: Option<usize>,
error: Option<String>,
at: i64,
}Expand description
What one rule is currently doing. Reported verbatim by /api/v1/alerts.
Fields§
§since: Option<i64>When the comparison first held, in wall nanoseconds. Cleared the moment
it stops holding, which is what makes hold a sustained breach rather
than a count of breaching evaluations.
firing: Option<i64>§value: f64§matched: usize§total: Option<usize>§error: Option<String>The last evaluation’s failure, if it failed. A rule whose query is unanswerable is not a quiet rule.
at: i64Implementations§
Source§impl State
impl State
Sourcefn advance(&mut self, breaching: bool, now: i64, hold: i64) -> Option<bool>
fn advance(&mut self, breaching: bool, now: i64, hold: i64) -> Option<bool>
Advance the state machine one evaluation, and say whether that is a
notification: Some(true) fired, Some(false) resolved, None nothing
changed.
A method rather than a match inside Engine::tick because the only
interesting thing in this file has a clock in it, and a test that drives
the clock has to drive this — a test carrying its own copy of these
arms would pass while the engine did something else, which is how the
last round of bugs in this repository survived its unit tests.
fn phase(&self) -> &'static str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].