# `mix release_benchmark`
[🔗](https://github.com/oliveigah/klife/blob/main/lib/mix/tasks/release_benchmark.ex#L1)

Runs real application workloads: catch-up lag, heavy synchronous production
(single and batch), heavy asynchronous production and latency-sensitive records.
Each has default and workload-optimized configurations. No dependency on `mix benchmark` or the test client.

    mix release_benchmark --start-kafka
    mix release_benchmark --baseline v1.2.0
    mix release_benchmark --seconds 1 --warmup 0 --samples 1 --levels 1

Options:

  * `--baseline REF` — compare a Git revision with this checkout, alternating
    version order each sample. Uses the same harness with each revision's deps.
  * `--start-kafka` — start the existing test Compose cluster; leaves it running.
  * `--kafka 4.4` — Compose version (default 4.4).
  * `--brokers HOST:PORT,...` — plaintext endpoints (default localhost ports
    19092,29092,39092). The cluster needs at least two brokers and Kafka 4+.
  * `--profile both|default|optimized` — default both.
  * `--scenario catchup_lag|heavy_sync_production|heavy_async_production|latency_sensitive_records` — run one scenario (default all).
  * `--levels 1,2,3` — increasing scale levels (default all).
  * `--seconds 5`, `--warmup 1`, `--samples 5` — per timed case/sample.
  * `--record-bytes 1024`, `--records-per-partition 10000` — consumer preload size.
  * `--output DIR` — result directory (default: a new timestamped folder under
    Git-ignored `bench/results/`). Includes `report.md`, per-sample Markdown,
    effective settings, CSV and raw samples; partial reports survive failures.

Catch-up ends when broker-stored committed offsets reach the backlog end.
Latency-sensitive records use low fixed arrival rates and measure scheduled-send to producer
acknowledgment AND consumer callback, including queueing. Heavy production cases
measure actual completions, including drain. See bench/README.md for scales,
profile settings, units and limitations. Runs use separate production VMs.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
