pub struct MetricsCollector { /* private fields */ }Expand description
Global metrics collector for SLO assessment operations.
This is a thread-safe singleton that accumulates metrics across all assessment and escalation operations.
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
Sourcepub fn record_assessment(
&self,
blocked_requests: u64,
total_requests: u64,
target_class: &str,
escalation_level: &str,
)
pub fn record_assessment( &self, blocked_requests: u64, total_requests: u64, target_class: &str, escalation_level: &str, )
Record an SLO assessment event.
This increments assessment counters and updates blocked ratio histogram.
Intended to be called after investigate_har() and infer_requirements_with_target_class().
Sourcepub fn to_prometheus(&self) -> String
pub fn to_prometheus(&self) -> String
Export metrics in Prometheus text format.
Sourcepub fn record_change_event(&self, event: &ChangeEvent)
pub fn record_change_event(&self, event: &ChangeEvent)
Record a single ChangeEvent
against the change-feed Prometheus counters.
Increments the change_feed_events_total
counter under the event’s classification
label.
§Example
use stygian_charon::change_feed::ChangeEventSink;
use stygian_charon::metrics::MetricsCollector;
let collector = MetricsCollector::new();
// Sink recording through the detector
// path:
// let detector = ChangeDetector::new();
// let report = detector.detect(&deltas, &collector);Sourcepub fn record_change_feed_run(&self)
pub fn record_change_feed_run(&self)
Record a single change-feed detection
cycle. Increments the change_feed_runs_total
counter. Callers typically invoke this once
per ChangeDetector::detect
call regardless of how many events were
emitted.
Trait Implementations§
Source§impl ChangeEventSink for MetricsCollector
Available on crate feature metrics only.
impl ChangeEventSink for MetricsCollector
metrics only.Source§fn record_change_event(&self, event: &ChangeEvent)
fn record_change_event(&self, event: &ChangeEvent)
ChangeEvent.Source§impl Clone for MetricsCollector
impl Clone for MetricsCollector
Source§fn clone(&self) -> MetricsCollector
fn clone(&self) -> MetricsCollector
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more