Crate hotpath

Crate hotpath 

Source
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
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.
measure_block
stream
Instrument a stream to track its item yields.

Structs§

FunctionLogsJson
Response containing recent logs for a function Each log entry is a tuple of (value, elapsed_nanos, optional_alloc_count, tid)
FunctionStats
FunctionsDataJson
Structured per-function profiling metrics data.
FunctionsJson
JSON representation of profiling metrics.
GuardBuilder
Builder for creating a hotpath profiling guard with custom configuration.
HotPath

Enums§

Format
Output format for profiling reports.
MetricType
Represents different types of profiling metrics with their values.
ProfilingMode
Profiling mode indicating what type of measurements were collected.
QueryRequest
Query request sent from TUI HTTP server to profiler worker thread
Route
HTTP routes for the hotpath metrics server.

Traits§

MetricsProvider
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.
shorten_function_name

Attribute Macros§

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 measure profiling macro.
skip
Marks a function to be excluded from profiling when used with measure_all.