pub struct SelectionMetrics { /* private fields */ }Expand description
Real-time metrics collector.
Thread-safe metrics collection for production use. Supports Prometheus export format.
Implementations§
Source§impl SelectionMetrics
impl SelectionMetrics
Sourcepub fn record_selection(
&self,
skill: &SkillName,
strategy: &str,
confidence: Confidence,
latency: Duration,
)
pub fn record_selection( &self, skill: &SkillName, strategy: &str, confidence: Confidence, latency: Duration, )
Record a successful selection.
Sourcepub fn record_timeout(&self, latency: Duration)
pub fn record_timeout(&self, latency: Duration)
Record a timeout.
Sourcepub fn record_no_match(&self, latency: Duration)
pub fn record_no_match(&self, latency: Duration)
Record when no skill was selected.
Sourcepub fn record_cache_hit(&self)
pub fn record_cache_hit(&self)
Record a cache hit.
Sourcepub fn record_cache_miss(&self)
pub fn record_cache_miss(&self)
Record a cache miss.
Sourcepub fn summary(&self) -> MetricsSummary
pub fn summary(&self) -> MetricsSummary
Get a summary of metrics.
Sourcepub fn to_prometheus(&self) -> String
pub fn to_prometheus(&self) -> String
Export metrics in Prometheus text format.
This format is compatible with Prometheus scraping and can be
exposed via the /metrics HTTP endpoint.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SelectionMetrics
impl RefUnwindSafe for SelectionMetrics
impl Send for SelectionMetrics
impl Sync for SelectionMetrics
impl Unpin for SelectionMetrics
impl UnsafeUnpin for SelectionMetrics
impl UnwindSafe for SelectionMetrics
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: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().