krabka_bench_driver/lib.rs
1//! Load driver and report aggregator for the Krabka vs Strimzi benchmark
2//! harness on Kubernetes.
3//!
4//! Scenarios describe a target Kafka stack, a workload shape, and optional
5//! disturbance windows. The driver applies the scenario to Kubernetes, runs
6//! the producer/consumer load, samples Prometheus, and writes a `RunOutput`
7//! JSON artifact. The report binary reads those artifacts back and renders
8//! the side-by-side Markdown summary used in benchmark reports.
9//!
10//! The crate ships two binaries:
11//!
12//! - `krabka-bench-driver` — runs one scenario against one Kafka stack,
13//! either Krabka or Strimzi/Kafka. It captures throughput, latency, and
14//! disturbance data, queries Prometheus for resource usage, and writes a
15//! single `RunOutput` JSON file.
16//! - `krabka-bench-report` — walks a directory of `RunOutput` files,
17//! groups them by scenario name, and writes a side-by-side Markdown
18//! summary.
19//!
20//! ## Dimensioned values
21//!
22//! Sizes, durations, and rates are [`krabka_units`] quantities throughout, and
23//! not bare numbers. A scenario's `msg_size` is a `ByteSize`, its `linger` and
24//! `duration` are a `Time`, and a paced run's `rate` is a `Frequency`. The
25//! operator writes them with units (`512B`, `5ms`, `20000/s`), and the measured
26//! `RunOutput` encodes them as exact integers. See [`scenario`] for the
27//! encoding of each field, and the [code style guide] for the vocabulary.
28//!
29//! [code style guide]: https://github.com/krabka-io/krabka-broker/blob/main/docs/style_guides/code_style_guide.md
30//!
31//! ## Command-line workflow
32//!
33//! ```text
34//! krabka-bench-driver \
35//! --scenario bench/scenarios/small-msg-saturate.yaml \
36//! --stack krabka \
37//! --namespace kafka-bench \
38//! --out runs/krabka-steady.json
39//!
40//! krabka-bench-report --input runs --out report.md
41//! ```
42//!
43//! ## Programmatic report aggregation
44//!
45//! ```no_run
46//! use {krabka_bench_driver::report, std::path::Path};
47//!
48//! # fn run() -> Result<(), Box<dyn std::error::Error>> {
49//! let markdown = report::render_markdown(Path::new("runs"), true)?;
50//! std::fs::write("report.md", markdown)?;
51//! # Ok(())
52//! # }
53//! ```
54
55pub mod aggregate;
56pub mod failover;
57pub mod graph;
58pub mod hist;
59pub mod ids;
60mod numeric;
61pub mod payload;
62pub mod prom;
63pub mod qualification;
64pub mod rate;
65pub mod report;
66pub mod scenario;
67pub mod soak;
68pub mod workload;