Expand description
Load driver + report aggregator for the Crabka vs Strimzi benchmark harness on Kubernetes.
Scenarios describe a target Kafka stack, a workload shape, and optional
disturbance windows. The driver applies the scenario to Kubernetes, runs
the producer/consumer load, samples Prometheus, and writes a RunOutput
JSON artifact. The report binary reads those artifacts back and renders
the side-by-side Markdown summary used in benchmark reports.
The crate ships two binaries:
crabka-bench-driver— runs one scenario against one Kafka stack (Crabka or Strimzi/Kafka), captures throughput / latency / disturbance data, queries Prometheus for resource usage, and writes a singleRunOutputJSON file.crabka-bench-report— walks a directory ofRunOutputfiles, groups them by scenario name, and emits a side-by-side Markdown summary.
§Command-line workflow
crabka-bench-driver \
--scenario bench/scenarios/steady_1p1r.toml \
--stack crabka \
--namespace kafka-bench \
--out runs/crabka-steady.json
crabka-bench-report --input runs --out report.md§Programmatic report aggregation
use crabka_bench_driver::report;
use std::path::Path;
let markdown = report::render_markdown(Path::new("runs"), true)?;
std::fs::write("report.md", markdown)?;Modules§
- failover
- Kill-broker orchestration for the
failoverscenario. Uses the in-clusterkubeAPI via the Job’sServiceAccount— theServiceAccountneedspods: get,list,deletein the target namespace, and is only mounted when a failover scenario actually requests it. - hist
- HDR histogram helpers. Latencies are recorded in microseconds with
(min=1us, max=60s, sigfig=3)— plenty of resolution from sub-ms up to degraded-broker timeouts, without blowing memory. - payload
- Record-payload generator. The first 24 bytes of every produced record
are reserved for
(magic_be, scenario_id_be, send_unix_nanos_be)so consumers can compute end-to-end latency by re-reading the embeddedsend_unix_nanos. The remaining bytes are a deterministic filler so the wire size is exactlymsg_size_bytes. - prom
- Prometheus query client. The driver issues a small set of instant queries at scenario end to capture resource usage on the broker pods and (Strimzi only) JVM heap / non-heap from the JMX exporter.
- rate
- Token-bucket pacer for
FixedRatescenarios.saturatemode never calls this — it justawaits the producer’s natural backpressure. - report
- Aggregate per-run JSON outputs into a single Markdown summary.
- scenario
Scenariois the on-disk YAML schema the driver reads;RunOutputis the on-disk JSON schema the driver writes. The report aggregator readsRunOutputdocuments and emits Markdown.- workload
- Producer + consumer workload runners. Builds N producers and M
consumers (members of one group), runs warmup → measurement
phases, optionally triggers a failover mid-measurement, and merges
per-task histograms into the public
LatencyPercentilesshape.