pub struct SimpleMetrics { /* private fields */ }Expand description
Simple atomic counter-based metrics system
Implementations§
Source§impl SimpleMetrics
impl SimpleMetrics
pub fn new() -> Self
pub fn is_enabled(&self) -> bool
Sourcepub fn request_start(&self) -> RequestTimer
pub fn request_start(&self) -> RequestTimer
Record request start (zero overhead when disabled)
Sourcepub fn token_generated(&self)
pub fn token_generated(&self)
Record token generation (zero overhead when disabled)
Sourcepub fn get_stats(&self) -> MetricsSnapshot
pub fn get_stats(&self) -> MetricsSnapshot
Get current statistics
Sourcepub async fn get_health_status(&self) -> HealthStatus
pub async fn get_health_status(&self) -> HealthStatus
Get health status
Sourcepub fn get_prometheus_metrics(&self) -> String
pub fn get_prometheus_metrics(&self) -> String
Get Prometheus-style metrics
Auto Trait Implementations§
impl !Freeze for SimpleMetrics
impl !RefUnwindSafe for SimpleMetrics
impl !UnwindSafe for SimpleMetrics
impl Send for SimpleMetrics
impl Sync for SimpleMetrics
impl Unpin for SimpleMetrics
impl UnsafeUnpin for SimpleMetrics
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more