@@ -54,22 +54,25 @@ authors = [
5454# ╚═══════════════════════════════════════════════════════════╝
5555[features ]
5656
57- # Standard Features
58- std = [] # Use the Rust standard library (disables no_std).
59- benchmark = [] # Benchmarking enabled (can be disabled for true zero-overhead).
60- metrics = [" std" ] # Use production metrics (Watch/Timer) and Rust standard library
61- # Gate perf-sensitive unit tests/benches so they can be opted into explicitly
62- perf-tests = []
63- long-tests = []
64-
65- # Use parking_lot for faster RwLock in hot paths
66- parking-lot-locks = [" dep:parking_lot" ]
57+ # Internal std switch (activated by higher-level features)
58+ std = []
59+
60+ # Core features
61+ default = [" benchmark" , " collector" ] # Turn-key dev: timing + in-process stats
62+ benchmark = [" std" ] # Enable real timing
63+ collector = [" std" ] # Collector + histogram
64+ metrics = [" collector" ] # Watch/Timer production metrics
65+
66+ # Precision backends
67+ high-precision = [" collector" ] # Swap to high-precision histogram backend
68+ hdr = [" high-precision" , " dep:hdrhistogram" ] # Use external HDR histogram backend
6769
68- # Feature Combinations
69- minimal = [] # Minimal build with core timing only (no default features).
70- default = [" std" , " benchmark" ] # Default features (includes std and benchmark).
71- standard = [" metrics" , " benchmark" ] # Default features (includes std and benchmark).
72- all = [" std" , " benchmark" , " metrics" ] # Complete build with all features enabled.
70+ # Perf/long tests are opt-in
71+ perf-tests = []
72+ long-tests = []
73+
74+ # Faster locks in hot paths (optional)
75+ parking-lot-locks = [" dep:parking_lot" ]
7376
7477
7578
@@ -106,6 +109,9 @@ harness = false
106109# Optional: faster synchronization primitives
107110parking_lot = { version = " 0.12" , optional = true }
108111
112+ # Optional: external HDR histogram backend
113+ hdrhistogram = { version = " 7" , optional = true }
114+
109115
110116# ╔═══════════════════════════════════════════════════════════╗
111117# ║ 🧩 DEV DEPENDENCIES
@@ -114,4 +120,42 @@ parking_lot = { version = "0.12", optional = true }
114120tokio = { version = " 1" , features = [" macros" , " rt-multi-thread" , " time" ] }
115121trybuild = " 1.0"
116122criterion = " 0.5"
117- proptest = " 1"
123+ proptest = " 1"
124+
125+ # ╔═══════════════════════════════════════════════════════════╗
126+ # ║ 🧪 EXAMPLES (with required-features)
127+ # ╚═══════════════════════════════════════════════════════════╝
128+ [[example ]]
129+ name = " zero_overhead"
130+ path = " examples/zero_overhead.rs"
131+ # zero_overhead should compile in no-default-features mode
132+
133+ [[example ]]
134+ name = " basic_cli"
135+ path = " examples/basic_cli.rs"
136+ required-features = [" benchmark" ]
137+
138+ [[example ]]
139+ name = " overhead_compare"
140+ path = " examples/overhead_compare.rs"
141+ required-features = [" benchmark" ]
142+
143+ [[example ]]
144+ name = " async_task"
145+ path = " examples/async_task.rs"
146+ required-features = [" benchmark" ]
147+
148+ [[example ]]
149+ name = " multi_threaded_collection"
150+ path = " examples/multi_threaded_collection.rs"
151+ required-features = [" collector" ]
152+
153+ [[example ]]
154+ name = " prometheus_textfile"
155+ path = " examples/prometheus_textfile.rs"
156+ required-features = [" metrics" ]
157+
158+ [[example ]]
159+ name = " web_server"
160+ path = " examples/web_server.rs"
161+ required-features = [" metrics" ]
0 commit comments