Module profiling

Module profiling 

Source
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§

AuthzProfiler
Performance profiler for authorization operations
OperationMetrics
Metrics for a specific operation
PerfCounter
Lightweight performance counter for hot paths
ProfilingStats
Overall profiling statistics