Skip to main content

tracing_prof/
lib.rs

1//! Profiling library for `tracing` that tracks various metrics
2//! such as CPU time, wall time, allocations, and heap usage.
3
4mod events;
5
6pub mod allocator;
7pub mod config;
8pub mod layer;
9pub mod reporter;
10pub mod sampler;
11
12pub use allocator::TrackingAllocator;
13pub use config::ProfileConfig;
14pub use layer::ProfileLayer;
15pub use reporter::ProfileReporter;
16
17#[cfg(feature = "performant")]
18pub(crate) type IndexMap<K, V> = indexmap::IndexMap<K, V, ahash::RandomState>;
19#[cfg(feature = "performant")]
20pub(crate) type IndexSet<T> = indexmap::IndexSet<T, ahash::RandomState>;
21
22#[cfg(not(feature = "performant"))]
23pub(crate) type IndexMap<K, V> = indexmap::IndexMap<K, V>;
24#[cfg(not(feature = "performant"))]
25pub(crate) type IndexSet<T> = indexmap::IndexSet<T>;
26
27#[cfg(feature = "performant")]
28pub(crate) type Instant = minstant::Instant;
29#[cfg(not(feature = "performant"))]
30pub(crate) type Instant = std::time::Instant;