pub struct EProcessOracle { /* private fields */ }Expand description
Anytime-valid anomaly oracle that signals when to shed low-priority work.
Thread-safe: all state is stored in atomics.
Implementations§
Source§impl EProcessOracle
impl EProcessOracle
Sourcepub fn new(config: EProcessConfig, priority_threshold: u8) -> Self
pub fn new(config: EProcessConfig, priority_threshold: u8) -> Self
Create a new oracle.
Sourcepub fn observe_sample(&self, anomaly: bool)
pub fn observe_sample(&self, anomaly: bool)
Record an observation. anomaly = true means an anomaly was observed.
Sourcepub fn observe_signal(&self, signal: EProcessSignal)
pub fn observe_signal(&self, signal: EProcessSignal)
Record a full telemetry signal and update the e-process classification.
Sourcepub fn observe_bridge(&self, bridge: &EProcessTelemetryBridge) -> bool
pub fn observe_bridge(&self, bridge: &EProcessTelemetryBridge) -> bool
Record the latest signal published into a telemetry bridge.
Returns true when a signal was present and consumed.
Sourcepub fn should_shed(&self, priority: u8) -> bool
pub fn should_shed(&self, priority: u8) -> bool
Returns true if the oracle recommends shedding a context at the given
priority level. Only sheds when priority > threshold AND e-value >= 1/alpha.
Sourcepub fn decision(&self, priority: u8) -> EProcessDecision
pub fn decision(&self, priority: u8) -> EProcessDecision
Build a decision artifact for a specific priority level.
Sourcepub fn rejection_threshold(&self) -> f64
pub fn rejection_threshold(&self) -> f64
Rejection threshold 1/alpha for the current oracle configuration.
Sourcepub const fn priority_threshold(&self) -> u8
pub const fn priority_threshold(&self) -> u8
Priority threshold for shedding.
Sourcepub fn snapshot(&self) -> EProcessSnapshot
pub fn snapshot(&self) -> EProcessSnapshot
Snapshot current oracle state.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EProcessOracle
impl RefUnwindSafe for EProcessOracle
impl Send for EProcessOracle
impl Sync for EProcessOracle
impl Unpin for EProcessOracle
impl UnsafeUnpin for EProcessOracle
impl UnwindSafe for EProcessOracle
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).