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.
Trait Implementations§
Source§impl Clone for MetricsCollector
impl Clone for MetricsCollector
Source§fn clone(&self) -> MetricsCollector
fn clone(&self) -> MetricsCollector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MetricsCollector
impl RefUnwindSafe for MetricsCollector
impl Send for MetricsCollector
impl Sync for MetricsCollector
impl Unpin for MetricsCollector
impl UnsafeUnpin for MetricsCollector
impl UnwindSafe for MetricsCollector
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