pub struct FieldObservation {
pub entries: Vec<FieldObservationEntry>,
pub events_observed: u64,
pub unique_keys: usize,
pub overflow_dropped: u64,
pub lifetime_events_observed: u64,
pub lifetime_overflow_dropped: u64,
pub max_keys: usize,
pub uptime_seconds: f64,
}Expand description
Immutable snapshot of an observer’s state at one moment in time.
Returned by FieldObserver::snapshot; consumers (the daemon’s
HTTP handlers, the engine eval report writer) render coverage
reports from this against a RuleFieldSet.
Fields§
§entries: Vec<FieldObservationEntry>Per-field counters, sorted by descending count then ascending name.
events_observed: u64Number of events evaluated by the observer since construction or the last reset.
unique_keys: usizeDistinct field names tracked (saturates at max_keys).
overflow_dropped: u64Number of insert attempts dropped because the observer was at capacity since the last reset.
lifetime_events_observed: u64Lifetime total of events evaluated since the observer was constructed, ignoring resets. Drives Prometheus counters, which must be monotonic.
lifetime_overflow_dropped: u64Lifetime total of insert attempts dropped because the observer was at capacity, ignoring resets. Drives Prometheus counters.
max_keys: usizeConfigured ceiling for distinct keys.
uptime_seconds: f64Seconds since the observer was created (or last reset).
Implementations§
Source§impl FieldObservation
impl FieldObservation
Sourcepub fn coverage<'a>(
&'a self,
rule_field_set: &'a RuleFieldSet,
) -> FieldCoverage<'a>
pub fn coverage<'a>( &'a self, rule_field_set: &'a RuleFieldSet, ) -> FieldCoverage<'a>
Join the snapshot against a RuleFieldSet and return the
partitioned coverage view in a single pass.
Returned references borrow from self (the entries) and the
supplied rule_field_set (the missing entries), so this is
allocation-light: one Vec for the unknown borrows, one Vec
for the missing borrows, one HashSet for the seen lookup.
Centralises the logic shared between the daemon’s
GET /api/v1/fields* handlers and the engine eval end-of-run
report so the two surfaces cannot drift on field semantics.
Trait Implementations§
Source§impl Clone for FieldObservation
impl Clone for FieldObservation
Source§fn clone(&self) -> FieldObservation
fn clone(&self) -> FieldObservation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FieldObservation
impl Debug for FieldObservation
Source§impl Default for FieldObservation
impl Default for FieldObservation
Source§fn default() -> FieldObservation
fn default() -> FieldObservation
Auto Trait Implementations§
impl Freeze for FieldObservation
impl RefUnwindSafe for FieldObservation
impl Send for FieldObservation
impl Sync for FieldObservation
impl Unpin for FieldObservation
impl UnsafeUnpin for FieldObservation
impl UnwindSafe for FieldObservation
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§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 referenceSource§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 pointerSource§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 pointerSource§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,
Source§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
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>
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