Expand description
A lightweight, easy-to-configure Rust profiler that shows exactly where your code spends time and allocates memory. Instrument any function or code block with to quickly spot bottlenecks, and focus your optimizations where they matter most.
§Setup & Usage
For a complete setup guide, examples, and advanced configuration, see the GitHub repository.
Modules§
- channels
- futures
- Futures instrumentation module - tracks async Future lifecycle and poll statistics.
- streams
- threads
- This module provides real-time thread monitoring capabilities, collecting CPU usage statistics for all threads in the current process.
Macros§
- channel
- Instrument a channel creation to wrap it with debugging proxies. Currently only supports bounded, unbounded and oneshot channels.
- future
- Instrument a future to inspect future’s lifecycle events.
- measure_
block - stream
- Instrument a stream to track its item yields.
Structs§
- Function
Logs Json - Response containing recent logs for a function
- Function
Stats - Functions
Data Json - Structured per-function profiling metrics data.
- Functions
Json - JSON representation of profiling metrics.
- Guard
Builder - Builder for creating a hotpath profiling guard with custom configuration.
- HotPath
Enums§
- Format
- Output format for profiling reports.
- Metric
Type - Represents different types of profiling metrics with their values.
- Profiling
Mode - Profiling mode indicating what type of measurements were collected.
- Query
Request - Query request sent from TUI HTTP server to profiler worker thread
- Route
- HTTP routes for the hotpath metrics server.
Traits§
- Metrics
Provider - Trait for accessing profiling metrics data from custom reporters.
- Reporter
- Trait for implementing custom profiling report output.
Functions§
- format_
bytes - Formats a byte count into a human-readable string with appropriate units.
- format_
duration - Formats a duration in nanoseconds into a human-readable string with appropriate units.
- measure_
with_ log - Measure a sync function and log its result.
- measure_
with_ log_ async - Measure an async function and log its result.
- shorten_
function_ name
Attribute Macros§
- future_
fn - Instruments an async function to track its lifecycle as a Future.
- main
- Initializes the hotpath profiling system and generates a performance report on program exit.
- measure
- Instruments a function to send performance measurements to the hotpath profiler.
- measure_
all - Instruments all functions in a module or impl block with the
measureprofiling macro. - skip
- Marks a function to be excluded from profiling when used with
measure_all.