pub struct TelemetryProvider { /* private fields */ }Expand description
Working telemetry provider for the role system.
Implementations§
Source§impl TelemetryProvider
impl TelemetryProvider
Sourcepub fn with_config(config: TelemetryConfig) -> Self
pub fn with_config(config: TelemetryConfig) -> Self
Create a new telemetry provider with custom configuration.
Sourcepub fn record_permission_check(
&self,
subject: &str,
action: &str,
resource: &str,
granted: bool,
)
pub fn record_permission_check( &self, subject: &str, action: &str, resource: &str, granted: bool, )
Record a permission check operation.
Sourcepub fn record_permission_check_error(
&self,
subject: &str,
action: &str,
resource: &str,
error: &Error,
)
pub fn record_permission_check_error( &self, subject: &str, action: &str, resource: &str, error: &Error, )
Record a permission check error.
Sourcepub fn record_role_operation(&self, operation: &str, role: &str, success: bool)
pub fn record_role_operation(&self, operation: &str, role: &str, success: bool)
Record a role operation.
Sourcepub fn record_cache_operation(&self, hit: bool)
pub fn record_cache_operation(&self, hit: bool)
Record cache operation.
Sourcepub fn record_operation_duration(&self, _operation: &str, duration: Duration)
pub fn record_operation_duration(&self, _operation: &str, duration: Duration)
Record operation duration.
Sourcepub fn get_metrics(&self) -> TelemetryMetrics
pub fn get_metrics(&self) -> TelemetryMetrics
Get current metrics snapshot.
Sourcepub fn reset_metrics(&self)
pub fn reset_metrics(&self)
Reset all metrics (useful for testing).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TelemetryProvider
impl RefUnwindSafe for TelemetryProvider
impl Send for TelemetryProvider
impl Sync for TelemetryProvider
impl Unpin for TelemetryProvider
impl UnwindSafe for TelemetryProvider
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