goose: Rust Load Testing with Exit Codes
goose builds your load test into a Rust binary you run with -u users -r hatch-rate -t run-time --report-file, capable of coordinated-omission-corrected metrics.
Goose is a Rust load-testing library (inspired by Locust) that you compile into a native binary. In CI you run that binary with a user count, hatch rate, and run time, and it can write an HTML report and enforce metrics.
What it does
A goose test is a Rust program defining scenarios and transactions; you build it with cargo and run the resulting binary. -u/--users sets total users, -r/--hatch-rate how fast to start them, and -t/--run-time the duration. --report-file writes an HTML report and it supports coordinated-omission mitigation for honest tail latency.
Common usage
# build once, then run as a plain binary in CI
cargo build --release
./target/release/loadtest \
--host http://localhost:8080 \
-u 100 -r 10 -t 2m \
--report-file report.html --no-reset-metricsOptions
| Flag | What it does |
|---|---|
| --host <url> | Base URL under test |
| -u, --users N | Total number of users to launch |
| -r, --hatch-rate N | Users started per second |
| -t, --run-time T | Duration, e.g. 2m, 30s |
| --report-file <path> | Write an HTML report |
| --no-reset-metrics | Keep metrics gathered during ramp-up |
| --running-metrics N | Print live metrics every N seconds |
In CI
Cache the cargo build so the binary is not recompiled every run. Gate by inspecting metrics in the test code (goose exposes aggregated metrics after execute()), returning a nonzero exit when p95 or the error rate breaches budget, or parse the report. Set -t so the run terminates and add a warm-up scenario or --no-reset-metrics deliberately.
Common errors in CI
error: no such subcommand or command not found means the binary was not built; run cargo build --release first. error sending request ... Connection refused (os error 111) means the --host is not accepting connections yet. A run that never stops means -t was omitted. WARNING: no GooseAttack scenarios registered means the test defined no scenarios to run.