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 more