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// Meta crate mirrors the main crate; some code is conditionally dead
8// depending on feature combinations (e.g. alloc code without global_allocator).
9#![allow(dead_code)]
10
11#[cfg(all(
12    feature = "hotpath-cpu-meta",
13    not(any(target_os = "macos", target_os = "linux"))
14))]
15compile_error!("the `hotpath-cpu-meta` feature is only supported on macOS and Linux");
16
17#[cfg(feature = "hotpath-meta")]
18#[doc(inline)]
19pub use lib_on::*;
20#[cfg(feature = "hotpath-meta")]
21mod lib_on;
22
23#[cfg(feature = "hotpath-meta")]
24pub use lib_on::channels;
25#[cfg(feature = "hotpath-meta")]
26pub use lib_on::futures;
27#[cfg(feature = "hotpath-meta")]
28pub use lib_on::streams;
29#[cfg(all(feature = "hotpath-meta", feature = "threads"))]
30pub use lib_on::threads;
31#[cfg(all(feature = "hotpath-meta", feature = "tokio"))]
32pub use lib_on::tokio_runtime;
33
34#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
35pub(crate) mod output;
36#[cfg(feature = "hotpath-meta")]
37pub use output::format_debug_truncated;
38#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
39pub use output::{
40    ceil_char_boundary, floor_char_boundary, format_bytes, format_count, format_duration,
41    format_percentile_header, format_percentile_key, parse_bytes, parse_count, parse_duration,
42    shorten_function_name, OutputDestination, ProfilingMode, MAX_LOG_LEN,
43};
44
45#[cfg(feature = "hotpath-meta")]
46pub(crate) mod output_on;
47
48#[cfg(feature = "hotpath-meta")]
49pub(crate) mod metrics_server;
50
51#[cfg(feature = "hotpath-mcp-meta")]
52pub(crate) mod mcp_server;
53
54#[allow(dead_code)]
55#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
56pub mod json;
57#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
58pub use json::Route;
59
60#[cfg(feature = "hotpath-meta")]
61pub(crate) mod instant;
62#[cfg(feature = "hotpath-meta")]
63pub(crate) mod tid;
64
65#[cfg(not(feature = "hotpath-meta"))]
66#[doc(inline)]
67pub use lib_off::*;
68#[cfg(not(feature = "hotpath-meta"))]
69mod lib_off;
70
71#[cfg(not(feature = "hotpath-meta"))]
72pub use lib_off::channels;
73#[cfg(not(feature = "hotpath-meta"))]
74pub use lib_off::futures;
75#[cfg(not(feature = "hotpath-meta"))]
76pub use lib_off::streams;
77#[cfg(not(feature = "hotpath-meta"))]
78pub use lib_off::threads;
79
80mod shared;
81pub use shared::{env_flag, Format, IntoF64, Section};
82
83#[doc(hidden)]
84pub mod dev_logging;