Expand description
Process-global live profiling.
Unlike Python’s package imports, Rust module declarations are resolved statically and do not execute in source order. The profiler can therefore stay in the normal crate module graph without a late-import workaround for circular initialization. Lightweight live profiling compatible with Reticulum’s profiler results.
Create a guard with profile or profile_with_parent. A capture is
registered immediately and completed when the guard is dropped, which makes
nested and reentrant calls independently visible without reporting partial
durations. Results are process-global and bounded per tag so the daemon can
expose them indefinitely over local and remote status APIs.
Structs§
- Profile
Guard - A timing sample that is completed when the guard is dropped.
- Profiling
Result - Profiling
Stats
Constants§
- MAX_
CAPTURES - Default maximum retained samples for each tag across all threads.
Functions§
- profile
- Start profiling a top-level tag with the default retention limit.
- profile_
function - Run a function or closure under a profiling tag and return its result.
- profile_
function_ with_ limit - Run a function or closure under a profiling tag with a custom retention limit and return its result.
- profile_
with_ limit - Start profiling a top-level tag with a custom per-tag retention limit.
- profile_
with_ parent - Start profiling a tag nested under
parentin formatted results. - profile_
with_ parent_ and_ limit - Start nested profiling with a custom per-tag retention limit.
- ran
- Return whether at least one timing sample has completed.
- results
- Return a stable, tag-sorted snapshot of all retained completed samples.
- results_
msgpack - Snapshot results in the dictionary shape used by remote management.
- results_
pickle - Snapshot results in the dictionary shape used by Python’s local RPC.