mod allocation;
mod cache;
mod core;
mod metrics;
mod report;
pub use allocation::{
AllocationSnapshot, ProfilingAllocator, allocation_snapshot, reset_allocation_counters,
set_allocation_tracking_enabled,
};
pub use cache::CacheStats;
pub use core::{ProfileGuard, Profiler, Timer, global_profiler};
pub use metrics::{CounterMetrics, Metrics};
pub use report::{CounterEntry, CounterSummary, ProfileEntry, ProfileSummary};
#[macro_export]
macro_rules! profile {
($name:expr, $block:expr) => {{
let name: &'static str = $name;
let profiler = $crate::profiler::global_profiler();
if profiler.is_enabled() {
let _profile_guard = profiler.global_span(name);
$block
} else {
$block
}
}};
}
#[cfg(test)]
mod tests;