Struct SopMetricsCollector
pub struct SopMetricsCollector { /* private fields */ }Expand description
Thread-safe SOP metrics aggregator. Bridges raw SOP audit events into queryable metrics for gate evaluation, health endpoints, and diagnostics.
Implementations§
Source§impl SopMetricsCollector
impl SopMetricsCollector
Sourcepub fn new() -> SopMetricsCollector
pub fn new() -> SopMetricsCollector
Create an empty collector (cold start).
Process-wide shared collector (production). The engine feeds it
(record_run_complete in finish_run) and the SOP tools report from it
(sop_status) / feed it (sop_approve), so they observe one set of
metrics. Tests use a fresh new() per engine for isolation.
Sourcepub fn record_run_complete(&self, run: &SopRun)
pub fn record_run_complete(&self, run: &SopRun)
Record a terminal run (Completed/Failed/Cancelled).
Call after audit.log_run_complete().
Sourcepub fn record_approval(&self, sop_name: &str, run_id: &str)
pub fn record_approval(&self, sop_name: &str, run_id: &str)
Record a human approval event.
Call after the gate resolves (the append-only ledger row is written inside
engine.resolve_gate).
Sourcepub fn record_capability_executed(&self, sop_name: &str)
pub fn record_capability_executed(&self, sop_name: &str)
EPIC G: record a deterministic capability step execution (global + per-SOP).
Sourcepub fn record_timeout_auto_approve(&self, sop_name: &str, run_id: &str)
pub fn record_timeout_auto_approve(&self, sop_name: &str, run_id: &str)
Record a timeout auto-approval event.
Call after the timeout action resolves the gate (the system-attributed
gate_resolved ledger row is written inside engine.resolve_gate).
pub async fn rebuild_from_persistence( memory: &dyn Memory, store: &dyn SopRunStore, ) -> Result<SopMetricsCollector, Error>
pub fn get_metric_value(&self, name: &str) -> Option<Value>
Trait Implementations§
Source§impl Default for SopMetricsCollector
impl Default for SopMetricsCollector
Source§fn default() -> SopMetricsCollector
fn default() -> SopMetricsCollector
Auto Trait Implementations§
impl !Freeze for SopMetricsCollector
impl RefUnwindSafe for SopMetricsCollector
impl Send for SopMetricsCollector
impl Sync for SopMetricsCollector
impl Unpin for SopMetricsCollector
impl UnsafeUnpin for SopMetricsCollector
impl UnwindSafe for SopMetricsCollector
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
§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>
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