pub struct MonitoringManager { /* private fields */ }
Expand description
Main monitoring manager
Implementations§
Source§impl MonitoringManager
impl MonitoringManager
Sourcepub fn new(config: MonitoringConfig) -> Self
pub fn new(config: MonitoringConfig) -> Self
Create new monitoring manager
Sourcepub async fn record_auth_request(&self)
pub async fn record_auth_request(&self)
Record authentication request
Sourcepub async fn record_auth_success(&self, user_id: &str, duration: Duration)
pub async fn record_auth_success(&self, user_id: &str, duration: Duration)
Record successful authentication
Sourcepub async fn record_auth_failure(&self, user_id: Option<&str>, reason: &str)
pub async fn record_auth_failure(&self, user_id: Option<&str>, reason: &str)
Record failed authentication
Sourcepub async fn record_token_creation(&self, token_type: &str)
pub async fn record_token_creation(&self, token_type: &str)
Record token creation
Sourcepub async fn record_token_validation(&self, valid: bool)
pub async fn record_token_validation(&self, valid: bool)
Record token validation
Sourcepub async fn update_session_count(&self, count: u64)
pub async fn update_session_count(&self, count: u64)
Update session count
Sourcepub async fn record_mfa_challenge(&self, method: &str)
pub async fn record_mfa_challenge(&self, method: &str)
Record MFA challenge
Sourcepub async fn record_security_event(&self, event: SecurityEvent)
pub async fn record_security_event(&self, event: SecurityEvent)
Record security event
Sourcepub fn get_performance_metrics(&self) -> HashMap<String, u64>
pub fn get_performance_metrics(&self) -> HashMap<String, u64>
Get current performance metrics
Sourcepub async fn get_security_events(
&self,
limit: Option<usize>,
) -> Vec<SecurityEvent>
pub async fn get_security_events( &self, limit: Option<usize>, ) -> Vec<SecurityEvent>
Get security events
Sourcepub async fn get_metrics_history(
&self,
metric_name: Option<&str>,
) -> Vec<MetricDataPoint>
pub async fn get_metrics_history( &self, metric_name: Option<&str>, ) -> Vec<MetricDataPoint>
Get metrics history
Sourcepub async fn health_check(&self) -> Result<HashMap<String, HealthCheckResult>>
pub async fn health_check(&self) -> Result<HashMap<String, HealthCheckResult>>
Perform health check
Sourcepub async fn export_prometheus_metrics(&self) -> String
pub async fn export_prometheus_metrics(&self) -> String
Export metrics in Prometheus format
Auto Trait Implementations§
impl Freeze for MonitoringManager
impl !RefUnwindSafe for MonitoringManager
impl Send for MonitoringManager
impl Sync for MonitoringManager
impl Unpin for MonitoringManager
impl !UnwindSafe for MonitoringManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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 more