crates/nornir-bench/Cargo.toml
[package]
name = "nornir-bench"
version = "0.2.0"
edition = "2021"
description = "Project-agnostic benchmark harness — a uniform run/result envelope with free-form per-repo metrics, append-only JSONL history, inventory-based bencher registration (register_bench!), telemetry sampling, and a live progress trail in nornir's viz action-log line format. Lifted out of nornir (no egui/viz dependency)."
license = "MIT OR Apache-2.0"
repository = "https://git.gunnar.rs/nordisk/edda"
keywords = ["benchmark", "harness", "telemetry"]
categories = ["development-tools::profiling"]
exclude = ["/.nornir/"]
[features]
# Opt-in canonical Maven Central JAR fixture set (project-specific data).
fixtures-maven = []
# Functional-status emit MODE: pull `nornir-testmatrix` and light this crate's
# `selftest::emit` bridge so bencher registration/run surfaces record honest
# matrix rows. OFF by default — release strips the emit to an `#[inline]` no-op
# and does NOT link `nornir-testmatrix`.
testmatrix = ["dep:nornir-testmatrix", "nornir-testmatrix/testmatrix"]
# `runner` — the OUTER runner (`runner::run_bench_example`): locate a repo's
# `nornir-bench` example, build it, run it, parse the `BenchRun` it prints.
#
# OFF by default and it must stay that way. The overwhelmingly common consumer
# links this crate to WRITE benchers (`register_bench!`) or to READ the envelope
# (`BenchRun`/`BenchResult`), and neither needs `toml` or a cargo subprocess. The
# two consumers that DO need it are the ones that spawn a measurement over a
# product: nornir (`nornir bench run`, kept as an alias) and dwarves
# (`dwarves bench run`, the forge verb). One copy, two consumers — LAW 5.
runner = ["dep:toml"]
[dependencies]
anyhow = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
chrono = { version = "0.4", features = ["serde"] }
inventory = "0.3"
# `BenchRun::id` — a PRODUCER-minted v7 uuid. v7 specifically: it is
# time-ordered, so the id sorts like the date and rows cluster in time. `serde`
# so the id rides the JSONL receipt; `js` is not needed (no wasm consumer).
uuid = { version = "1", features = ["v7", "serde"] }
# `sysconf(_SC_CLK_TCK)` only — the divisor for /proc/self/stat's tick counters.
# Queried, not hardcoded to 100 (see `telemetry::clock_ticks_per_sec`).
libc = "0.2"
ureq = { version = "3", default-features = false, features = ["rustls"] }
nornir-cli-outcome = { version = "0.1.3", path = "../nornir-cli-outcome" }
nornir-testmatrix = { version = "0.2.7", path = "../nornir-testmatrix", optional = true }
# `runner` only: reading a repo's ROOT manifest for the SUBJECT version stamp
# (`runner::subject_version` tiers 1-2) and asking a bench package whether it
# declares an `s3` feature before folding one in. Same 0.8 the rest of the
# constellation pins, so cargo unifies.
toml = { version = "1", optional = true }
[dev-dependencies]
# The discovery tests in `runner` build throwaway repo layouts on disk (a repo
# root, a detached `bench/` workspace, a `[[example]]` with a custom path) and
# then ask `cargo metadata` about them, because that is the one thing a fixture
# string cannot fake.
tempfile = "3"