Expand description
Performance profiling utilities for authorization operations
This module provides tools to measure and analyze the performance of authorization checks, helping identify bottlenecks and optimization opportunities.
§Example
use oxify_authz::profiling::*;
use std::time::Duration;
let profiler = AuthzProfiler::new();
// Profile a check operation
let result = profiler.profile_async("check_document_viewer", async {
// Your authorization check here
Ok::<bool, Box<dyn std::error::Error>>(true)
}).await?;
// Get profiling statistics
let stats = profiler.get_stats();
println!("Total operations: {}", stats.total_operations);
println!("Average latency: {:?}", stats.avg_latency());Structs§
- Authz
Profiler - Performance profiler for authorization operations
- Operation
Metrics - Metrics for a specific operation
- Perf
Counter - Lightweight performance counter for hot paths
- Profiling
Stats - Overall profiling statistics