xburner #
xburner is an experimental HTTP and gRPC load generator written in Zig.
It supports two execution styles:
simplemode: a host-defined HTTP scenario driven directly from configworkflowmode: a Wasm guest defines the request/response state machine
The current workflow runtime defaults to WAMR. wasm3 is still kept in the repository as a comparison backend and for runtime experiments.
Status #
The project is usable for local development and end-to-end validation, but it is still under active development. The public interface is stabilizing, while runtime internals and platform support are still moving.
Highlights #
xburner validate <config>xburner validate --dry-run <config>xburner validate --with-setup <config>xburner run <config>- HTTP/1.1 transport
- opt-in HTTP/2 transport for HTTPS targets via
http.version = "auto"orhttp.version = "2" - gRPC unary transport over HTTP/2/TLS
- host-managed cookie jar with
cookie_jar_scope = "vu"orcookie_jar_scope = "iteration" - custom TLS options for HTTPS targets:
ca_file,server_name,insecure_skip_verify - request-level defaults in
[http.defaults]for headers, timeouts, capture, and response-body handling - separate
connect_timeout_msandtimeout_mscontrols for manual transport paths - guest
setup/teardownhooks with sharedsetup.*distribution ramping-vusin addition toconstant-vusandconstant-arrival-rate- OTLP/HTTP metric export via OpenTelemetry
- setup requests and threshold evaluation
- built-in request checks for status code, body substring, and response header presence
- machine-readable JSON probe output for
--dry-runand--with-setup - machine-readable JSON summary output for
run - workflow recovery with
script_timeoutandmax_poisoned_workers - fixed-size latency histograms for percentile reporting during long runs
Requirements #
The local setup flow is currently maintained for macOS and Linux.
- macOS
- Linux
- Zig
0.15.2 - Git
- Go
- CMake
- a working C/C++ toolchain
- Homebrew
grpc - Homebrew
pkgconf
Setup #
third_party is intentionally not committed. Use the init script before building:
sh scripts/init.sh
What the script does:
- clones
wasm3frommain - clones
wamrat a pinned revision - clones
zig-o11y/opentelemetry-sdkat pinned upstream commite92f7652e5c639d52c8be3b6836429dfefaaed6d - prepares the local
third_party/tree used by the build
The WAMR helper build is cached under .zig-cache/wamr-build and rebuilt incrementally when the local WAMR source tree changes.
The workflow sample guest can also be rebuilt on demand with scripts/build_workflow_sample_wasm.sh.
The gRPC transport backend links against the system C++ gRPC package and expects:
brew install grpc pkgconf go
Install #
See:
Licensing #
The repository's original source is currently distributed under the terms in LICENSE. Third-party runtime dependencies are documented in NOTICE and licenses.
Build And Test #
zig build test
On Linux, use the wrapper that builds the gRPC shim with the system compiler:
sh scripts/build_linux.sh
sh scripts/test_linux_unit.sh
On Linux and in Ubuntu CI reproduction, use:
sh scripts/test_linux_unit.sh
To reproduce the Ubuntu CI toolchain locally with Docker:
sh hacks/test_ubuntu_docker.sh
To force the same linux/amd64 userspace as CI:
sh hacks/test_ubuntu_docker.sh --platform linux/amd64
More testing details:
Release process details:
CLI #
zig build run -- --version
zig build run -- version
zig build run -- validate <config>
zig build run -- validate --dry-run <config>
zig build run -- validate --with-setup <config>
zig build run -- validate --wasm-backend wasm3 <config>
zig build run -- run <config>
zig build run -- run --wasm-backend wamr <config>
Behavior:
--versionandversionprint the build versionvalidatechecks config syntax, schema, and workflow ABI/exportsvalidate --dry-runemits a JSON probe instead of executing the full runvalidate --with-setupexecutessetup.requestsand emits a JSON proberunwrites progress tostderrand a final JSON summary tostdout
JSON output contract:
- probe output includes
schema_version,kind,scenario_mode,wasm_backend,setup_requests, andmeasured_requests - run summary includes
schema_version,scenario_name,scenario_mode,wasm_backend,interrupted,measured,warmup, andthresholds_failed - arrival-rate windows also report scheduler lag metrics in the summary
measured.request_summariesandwarmup.request_summariesinclude per-request aggregates for named request templates- transport timeouts are reported separately from other transport errors in both window summaries and request summaries
- current versions: probe schema
1, summary schema2
More output details:
Configuration #
See:
Config files may also use include = "./common.toml" and env_file = "./.env" to share fragments and environment values before parsing.
Workflow ABI #
Workflow guests are expected to export:
get_abi_versioninitstart_iterationnext_requesthandle_response
Host functions are available in the env, host, and xburner namespaces:
host_rand_u64host_now_nanoshost_loghost_get_varhost_set_varhost_get_response_headerhost_check_abort
See samples/workflow-health.c for a minimal guest example.
More workflow guest details:
- docs/workflow-guest.md
- include/xburner_workflow_guest.h
- templates/workflow-guest.c
- templates/workflow-guest.rs
- templates/workflow-guest.go
- hacks/scaffold_workflow.sh
Samples #
Simple Mode #
The repository includes a simple sample config at samples/simple-healthcheck.toml.
This sample expects a local service at http://127.0.0.1:18080/health.
Example commands:
python3 hacks/simple_fixture_server.py
zig build run -- validate samples/simple-healthcheck.toml
zig build run -- validate --dry-run samples/simple-healthcheck.toml
zig build run -- run samples/simple-healthcheck.toml
For unary gRPC, see samples/simple-grpc-echo.toml. It targets the local fixture server from hacks/grpc_fixture_server.go. You can run both gRPC samples with:
sh scripts/test_samples.sh grpc
Distributed Mode #
For a coordinator / agent sample, see samples/distributed-healthcheck.toml.
This sample uses the same local fixture server as the simple HTTP sample.
Example flow:
python3 hacks/simple_fixture_server.py
In two other shells, start agents:
zig build run -- agent --listen 127.0.0.1:19091
zig build run -- agent --listen 127.0.0.1:19092
Then run the coordinator:
zig build run -- run-distributed \
--agent 127.0.0.1:19091 \
--agent 127.0.0.1:19092 \
samples/distributed-healthcheck.toml
Plugin Exporter #
For a sample exporter plugin config, see samples/plugin-csv-healthcheck.toml.
This writes a CSV summary row to /tmp/xburner-plugin-sample.csv using the sample plugin in samples/plugins/csv.
Run it from the repository root so the relative plugins.dir resolves correctly.
python3 hacks/simple_fixture_server.py
zig build run -- run samples/plugin-csv-healthcheck.toml
cat /tmp/xburner-plugin-sample.csv
Workflow Mode #
The workflow sample lives in:
- samples/workflow-health.toml
- samples/workflow-health.c
- samples/workflow-grpc-echo.toml
- samples/workflow-grpc-echo.c
The sample guest can be compiled with:
sh scripts/build_workflow_sample_wasm.sh
This sample expects a local service at:
http://127.0.0.1:18082/loginhttp://127.0.0.1:18082/me
You can start the local workflow sample server with:
python3 hacks/workflow_fixture_server.py
The sample config uses a relative Wasm path, so either:
- run
xburnerfrom thesamples/directory, or - replace the Wasm path with an absolute path before running it
One workable flow is:
python3 ../hacks/workflow_fixture_server.py
In a second shell:
zig build
cd samples
../zig-out/bin/xburner validate workflow-health.toml
../zig-out/bin/xburner run workflow-health.toml
To run the same workflow on the comparison backend, add this line to the sample config:
wasm_backend = "wasm3"
Validation Scripts #
See:
Current Limitations #
- The local setup and CI flow currently target macOS and Linux only.
- gRPC support is currently unary-only.
validate --dry-runandvalidate --with-setupare probes, not full execution.- The workflow runtime defaults to WAMR, while
wasm3remains in-tree as a comparison backend. - Relative plugin paths are resolved from the current working directory, not the config file location.
third_party/is local state produced byscripts/init.sh; it is not part of the committed repository.
Repository Notes #
Important local paths:
- source: src
- samples: samples
- setup script: scripts/init.sh