pub struct RoleSystemMetrics {
pub permission_checks: Arc<AtomicU64>,
pub cache_hits: Arc<AtomicU64>,
pub cache_misses: Arc<AtomicU64>,
pub role_assignments: Arc<AtomicU64>,
pub role_removals: Arc<AtomicU64>,
pub role_elevations: Arc<AtomicU64>,
pub permission_check_durations: Arc<DashMap<String, Duration>>,
pub error_counts: Arc<DashMap<String, AtomicU64>>,
pub subject_activity: Arc<DashMap<String, AtomicU64>>,
}Expand description
Metrics collector for role system operations.
Fields§
§permission_checks: Arc<AtomicU64>Number of permission checks performed.
cache_hits: Arc<AtomicU64>Number of cache hits.
cache_misses: Arc<AtomicU64>Number of cache misses.
role_assignments: Arc<AtomicU64>Number of role assignments.
role_removals: Arc<AtomicU64>Number of role removals.
role_elevations: Arc<AtomicU64>Number of role elevations.
permission_check_durations: Arc<DashMap<String, Duration>>Permission check durations (simplified histogram).
error_counts: Arc<DashMap<String, AtomicU64>>Error counts by type.
subject_activity: Arc<DashMap<String, AtomicU64>>Subject activity counts.
Implementations§
Source§impl RoleSystemMetrics
impl RoleSystemMetrics
Sourcepub fn record_permission_check(&self, duration: Duration)
pub fn record_permission_check(&self, duration: Duration)
Record a permission check.
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 record_role_assignment(&self, subject_id: &str)
pub fn record_role_assignment(&self, subject_id: &str)
Record a role assignment.
Sourcepub fn record_role_removal(&self, subject_id: &str)
pub fn record_role_removal(&self, subject_id: &str)
Record a role removal.
Sourcepub fn record_role_elevation(&self, subject_id: &str)
pub fn record_role_elevation(&self, subject_id: &str)
Record a role elevation.
Sourcepub fn record_error(&self, error_type: &str)
pub fn record_error(&self, error_type: &str)
Record an error.
Sourcepub fn record_subject_activity(&self, subject_id: &str)
pub fn record_subject_activity(&self, subject_id: &str)
Record subject activity.
Sourcepub fn cache_hit_ratio(&self) -> f64
pub fn cache_hit_ratio(&self) -> f64
Get cache hit ratio.
Sourcepub fn summary(&self) -> MetricsSummary
pub fn summary(&self) -> MetricsSummary
Get metrics summary.
Trait Implementations§
Source§impl Clone for RoleSystemMetrics
impl Clone for RoleSystemMetrics
Source§fn clone(&self) -> RoleSystemMetrics
fn clone(&self) -> RoleSystemMetrics
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 moreSource§impl Debug for RoleSystemMetrics
impl Debug for RoleSystemMetrics
Auto Trait Implementations§
impl Freeze for RoleSystemMetrics
impl !RefUnwindSafe for RoleSystemMetrics
impl Send for RoleSystemMetrics
impl Sync for RoleSystemMetrics
impl Unpin for RoleSystemMetrics
impl !UnwindSafe for RoleSystemMetrics
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