Skip to main content

hotpath_meta/
lib.rs

1//! hotpath-rs is a simple async Rust profiler. It instruments functions, channels, futures, and streams to quickly find bottlenecks and focus optimizations where they matter most.
2//! It can provide actionable insights into time, memory, and data flow with minimal setup.
3//! ## Setup & Usage
4//! For a complete setup guide, examples, and advanced configuration, visit
5//! [hotpath.rs](https://hotpath.rs).
6
7#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
8#[doc(inline)]
9pub use lib_on::*;
10#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
11mod lib_on;
12
13#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
14pub use lib_on::channels;
15#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
16pub use lib_on::data_flow;
17#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
18pub use lib_on::futures;
19#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
20pub use lib_on::streams;
21#[cfg(all(
22    feature = "hotpath-meta",
23    not(feature = "hotpath-off-meta"),
24    feature = "threads"
25))]
26pub use lib_on::threads;
27#[cfg(all(
28    feature = "hotpath-meta",
29    not(feature = "hotpath-off-meta"),
30    feature = "tokio"
31))]
32pub use lib_on::tokio_runtime;
33
34#[cfg(any(feature = "hotpath-meta", feature = "ci", feature = "tui"))]
35pub(crate) mod output;
36#[cfg(any(feature = "hotpath-meta", feature = "ci", feature = "tui"))]
37pub use output::{
38    ceil_char_boundary, floor_char_boundary, format_bytes, format_duration, shorten_function_name,
39    truncate_result, FunctionLogsList, FunctionsData, MetricType, MetricsProvider,
40    OutputDestination, ProfilingMode, MAX_RESULT_LEN,
41};
42
43#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
44pub(crate) mod output_on;
45
46#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
47pub(crate) mod metrics_server;
48
49#[cfg(all(feature = "hotpath-meta-mcp", not(feature = "hotpath-off-meta")))]
50pub(crate) mod mcp_server;
51
52#[cfg(any(feature = "hotpath-meta", feature = "ci", feature = "tui"))]
53pub mod json;
54#[cfg(any(feature = "hotpath-meta", feature = "ci", feature = "tui"))]
55pub use json::Route;
56
57#[cfg(all(feature = "hotpath-meta", not(feature = "hotpath-off-meta")))]
58pub(crate) mod tid;
59
60// When hotpath feature is not enabled or hotpath-off-meta is enabled, use no-op stubs
61#[cfg(any(not(feature = "hotpath-meta"), feature = "hotpath-off-meta"))]
62#[doc(inline)]
63pub use lib_off::*;
64#[cfg(any(not(feature = "hotpath-meta"), feature = "hotpath-off-meta"))]
65mod lib_off;
66
67#[cfg(any(not(feature = "hotpath-meta"), feature = "hotpath-off-meta"))]
68pub use lib_off::channels;
69#[cfg(any(not(feature = "hotpath-meta"), feature = "hotpath-off-meta"))]
70pub use lib_off::futures;
71#[cfg(any(not(feature = "hotpath-meta"), feature = "hotpath-off-meta"))]
72pub use lib_off::streams;
73
74mod shared;
75pub use shared::{Format, IntoF64};