crates/nornir-flight/examples/nornir-bench.rs
//! The `nornir-bench` harness entrypoint for nornir-flight (feature `bench`).
//!
//! Collects every `register_bench!`'d bencher (here: `bench::FlightThroughput`),
//! runs them, and prints one JSON `BenchRun` on stdout — with host cores + peak
//! memory telemetry stamped by the harness. Run it with:
//!
//! ```text
//! cargo run --release -p nornir-flight --features bench --example nornir-bench
//! ```
//!
//! Referencing `nornir_flight` links the crate (compiled with `bench`), so its
//! `inventory`-registered benchers are discovered at link time.
fn main() -> anyhow::Result<()> {
// Touch the crate so the linker keeps its `inventory` bencher registration.
let _ = nornir_flight::bench::FlightThroughput::default();
nornir_bench::api::run_main_json()
}