Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Load testing through a gateway

Load test mode, the harness, makes Rustybin the load client as well as the upstream: one node sends a scenario's traffic through the gateway under test and the same node (or other nodes) answers behind it, so the report can tell what the gateway did from what the upstream did, request by request. It is off by default and never on in public mode. This page is the guide; the reference tables (every variable, pattern, test, pool and fault) are in configuration, and the design in docs/plans/harness.md.

What you get:

  • Scenarios: targets, traffic layers with run patterns (constant, ramp, step, spike, pulse, burst, wave, the closed loops target and breakpoint, chained with then:), open (requests per second) or closed (users with think time) load, request templates, traffic from an OpenAPI mock, LLM streams, SSE, WebSocket, gRPC and MCP calls, identities (API keys, minted JWTs, OAuth clients, forwarded addresses), fault presets and thresholds. One JSON Schema drives the API, the management MCP and the console builder.
  • Correlation: every request is signed and tagged; the report classes every answer as upstream, gateway (made by the gateway), transport or lost, measures the gateway's overhead, and lists what it changed on the way.
  • Rate-limit tests against the limiter in front: window edges, distributed counters, many keys and IPs, retries, a limit probe, with an analysis in words and numbers.
  • A cluster: client nodes split the rate, server nodes answer, one report; the leader can fail over without a gap in the load.
  • Live tuning of a running run, a feed, reports as JSON, text and JUnit, headless runs with exit codes for CI.

Turn it on

RUSTYBIN_HARNESS=on RUSTYBIN_HARNESS_ROLES=both \
RUSTYBIN_HARNESS_TARGETS=gateway.internal,10.0.0.0/8 rustybin

RUSTYBIN_HARNESS_ROLES is client (sends load), server (answers behind the gateway), both (loop-through: the node sends to a gateway that routes back to it, the one-box demo) or coordinator (leads a cluster), comma separated. A client needs RUSTYBIN_HARNESS_TARGETS: the hosts, domains, addresses and CIDRs it may send load to, and nothing else; names are resolved once per run and the connections pinned. Starting with RUSTYBIN_HARNESS=on in public mode, with self-service mocks, or as a client with no targets is a fatal error.

The control routes live under /_rustybin/harness. Reads are open like the rest of the control plane; starting, changing and stopping runs follows the admin token on an open control plane and needs the harness (or admin) scope on a protected one (control-plane security).

GET {{harness_url}}/_rustybin/harness
HTTP 200
[Asserts]
jsonpath "$.enabled" == true
jsonpath "$.roles" contains "client"
jsonpath "$.roles" contains "server"
jsonpath "$.allowlist" contains "127.0.0.1"
jsonpath "$.caps.max_rate" == 50000
jsonpath "$.active_run" == null
jsonpath "$.kill_switch" == false

With RUSTYBIN_HARNESS_VERIFY_TARGETS=true (always on in hosted mode) every target must serve the node's token at this path before a run starts; a gateway that routes to the node passes, which also proves the route before any load is sent:

GET {{harness_url}}/.well-known/rustybin-harness
HTTP 200
[Asserts]
header "Content-Type" contains "text/plain"
body matches "^[0-9a-f]{32}$"

What verification proves, and what it does not. The token is public: the node serves it to anyone, without a credential, and a cluster's server nodes serve the cluster's. A target passes when a GET of its URL plus /.well-known/rustybin-harness answers 2xx with the token, so passing proves that the target routes that path to a node that serves the token (or to anything that copied it), and that the route works. It does not prove that whoever owns the target agreed to the load: a server that fetched the token and serves it passes as well, and so does one that relays the path to a node. Consent and scope come from the allowlist (RUSTYBIN_HARNESS_TARGETS, set by the operator) and the caps; verification catches a typo in a target, a route that does not reach the cluster, and a gateway in front of the wrong instance. A random challenge would not change that (a relay passes it too), so there is none.

A scenario

A scenario is YAML or JSON. The smallest one names a target, a request and a pattern:

# The smallest useful run: a steady, low rate against one target for a few
# seconds, with strict pass criteria. Copy it, change the target and go.
name: smoke
description: 50 requests per second to /status/200 for 10 seconds; fails on any error or saturation.
target: http://127.0.0.1:8080
source:
  request:
    method: GET
    path: /status/200
pattern:
  type: constant
  rate: 50
  for: 10s
timeout: 5s
thresholds:
  error_rate: 0
  not_sent: 0
  latency_p99_ms: 500
  saturated: false

The full shape has targets with weights, scale (virtual clients, connections, the cluster's node counts), layers (each with a source, a pattern, a model, identities, expect and thresholds), a timeout, run-level thresholds, a servers profile for the shaped upstream at /harness/*, and faults. A request template takes method, path, headers, query and body with {{seq}} (the request number), {{vu}} (the virtual client), {{id}} (the identity) and {{ip}} (a forwarded address), and requests is a weighted list of them. GET /_rustybin/harness/schema is the JSON Schema with the node's caps as bounds, and GET /_rustybin/harness/scenarios lists the built-ins (smoke, ramp-to-target, soak, closed-users, step-plateaus, breakpoint, spike-and-recover, pulse, burst, daily-wave, rate-limit, limit-probe, many-ips, petstore-customers, llm-streaming, flaky-upstream, jittery-clients) to copy:

GET {{harness_url}}/_rustybin/harness/schema
HTTP 200
[Asserts]
jsonpath "$.properties.layers" exists
jsonpath "$.properties.faults" exists
jsonpath "$['$defs'].pattern.oneOf" count >= 10
jsonpath "$['$defs'].change" exists
jsonpath "$['x-caps'].max_rate" == 50000
GET {{harness_url}}/_rustybin/harness/scenarios
HTTP 200
[Asserts]
jsonpath "$.scenarios[*].name" contains "smoke"
jsonpath "$.scenarios[*].name" contains "rate-limit"
jsonpath "$.scenarios[*].name" contains "llm-streaming"
jsonpath "$.scenarios[0].summary.expected_requests" == 500

GET {{harness_url}}/_rustybin/harness/scenarios/smoke?format=yaml
HTTP 200
[Asserts]
header "Content-Type" contains "yaml"
body contains "type: constant"

Validate a scenario before running it. The answer normalises it, hashes it (the hash is in every report) and summarises the layers, stages, peak rate and expected requests:

POST {{harness_url}}/_rustybin/harness/validate
Content-Type: application/yaml

name: ramp-check target: {{harness_url}} source: request: path: /status/200 pattern: type: ramp from: 10 to: 100 over: 30s thresholds: error_rate: 0.01

HTTP 200
[Asserts]
jsonpath "$.valid" == true
jsonpath "$.problems" count == 0
jsonpath "$.summary.duration_secs" == 30
jsonpath "$.summary.peak_rate" == 100
jsonpath "$.summary.expected_requests" == 1650
jsonpath "$.summary.layers[0].stages[0].type" == "ramp"
jsonpath "$.hash" matches "^[0-9a-f]{64}$"
# A scenario over the node's caps is not valid; the problems say why.
POST {{harness_url}}/_rustybin/harness/validate
Content-Type: application/json
{
  "name": "too-much",
  "target": "{{harness_url}}",
  "source": {"request": {"path": "/status/200"}},
  "pattern": {"type": "constant", "rate": 100000, "for": "5s"}
}
HTTP 200
[Asserts]
jsonpath "$.valid" == false
jsonpath "$.problems[0]" contains "over the cap of 50000"

# An unknown field is a parse error.
POST {{harness_url}}/_rustybin/harness/validate
Content-Type: application/json
{"name": "typo", "target": "{{harness_url}}", "patern": {"type": "constant", "rate": 1, "for": "1s"}}
HTTP 400
[Asserts]
jsonpath "$.error" contains "unknown field `patern`"

A preview is the pattern math without sending anything: the expected requests per second of every layer and in total, one point per second (coarser past an hour), which the console draws as you edit:

POST {{harness_url}}/_rustybin/harness/preview
Content-Type: application/json
{
  "name": "ramp-then-hold",
  "target": "{{harness_url}}",
  "source": {"request": {"path": "/status/200"}},
  "pattern": {
    "type": "ramp", "from": 10, "to": 100, "over": "30s",
    "then": {"type": "constant", "rate": 100, "for": "30s"}
  }
}
HTTP 200
[Asserts]
jsonpath "$.valid" == true
jsonpath "$.duration_secs" == 60
jsonpath "$.step_secs" == 1
jsonpath "$.points" == 60
jsonpath "$.peak_rate" == 100
jsonpath "$.total[0]" == 11.5
jsonpath "$.total[59]" == 100
jsonpath "$.layers[0].expected_requests" == 4650
jsonpath "$.layers[0].stages" count == 2

Save a scenario by name next to the built-ins (validated; kept in RUSTYBIN_HARNESS_STATE_DIR when set). Wherever a scenario is shown (the API, the management tools, a report), credential-looking header values, listed API keys, OAuth client secrets and secret-looking query values in its paths read [redacted]:

PUT {{harness_url}}/_rustybin/harness/scenarios/my-smoke
Authorization: Bearer {{admin_token}}
Content-Type: application/yaml

name: my-smoke target: {{harness_url}} source: request: path: /status/200 pattern: type: constant rate: 5 for: 2s

HTTP 201
[Asserts]
jsonpath "$.saved" == true
jsonpath "$.summary.expected_requests" == 10

GET {{harness_url}}/_rustybin/harness/scenarios
HTTP 200
[Asserts]
jsonpath "$.saved[0].name" == "my-smoke"

GET {{harness_url}}/_rustybin/harness/scenarios/my-smoke
HTTP 200
[Asserts]
jsonpath "$.name" == "my-smoke"
jsonpath "$.pattern.rate" == 5

DELETE {{harness_url}}/_rustybin/harness/scenarios/my-smoke
Authorization: Bearer {{admin_token}}
HTTP 204

Run it

POST /_rustybin/harness/runs validates the scenario, pins (and when configured verifies) its targets and starts sending. One run at a time per node.

# Start a run: 20 requests per second to this node itself for 3 seconds.
POST {{harness_url}}/_rustybin/harness/runs
Authorization: Bearer {{admin_token}}
Content-Type: application/json
{
  "name": "docs-run",
  "target": "{{harness_url}}",
  "source": {"request": {"path": "/status/200"}},
  "pattern": {"type": "constant", "rate": 20, "for": "3s"},
  "timeout": "2s",
  "thresholds": {"error_rate": 0, "latency_p99_ms": 500, "saturated": false}
}
HTTP 202
[Captures]
run_id: jsonpath "$.run_id"
[Asserts]
header "Location" matches "^/_rustybin/harness/runs/[0-9a-f]+$"
jsonpath "$.state" matches "^(starting|running)$"
jsonpath "$.planned_secs" == 3
jsonpath "$.share" == 1
jsonpath "$.links.report" exists
# On an open control plane with an admin token, starting load needs it.
POST {{harness_url}}/_rustybin/harness/runs
Content-Type: application/json
{"name": "x", "target": "{{harness_url}}", "source": {"request": {"path": "/"}}, "pattern": {"type": "constant", "rate": 1, "for": "1s"}}
HTTP 401
# A target outside RUSTYBIN_HARNESS_TARGETS never gets a single request.
POST {{harness_url}}/_rustybin/harness/runs
Authorization: Bearer {{admin_token}}
Content-Type: application/json
{
  "name": "elsewhere",
  "target": "https://api.example.com",
  "source": {"request": {"path": "/"}},
  "pattern": {"type": "constant", "rate": 1, "for": "1s"}
}
HTTP 403
[Asserts]
jsonpath "$.error" == "a target is not allowed on this node"
jsonpath "$.problems[0]" contains "api.example.com:443 is not in RUSTYBIN_HARNESS_TARGETS"

While it runs, GET .../runs/<run> is the live view (counts, classes, latency so far, the last second, every layer's stage and target rate, saturation), and GET .../runs/<run>/events is the same as a feed of server-sent events: a snapshot every second, change, finding and finished.

GET {{harness_url}}/_rustybin/harness/runs/{{run_id}}
[Options]
delay: 1000
HTTP 200
[Asserts]
jsonpath "$.state" == "running"
jsonpath "$.sent" > 0
jsonpath "$.in_flight" >= 0
jsonpath "$.layers[0].target_now" == 20
jsonpath "$.layers[0].stage.type" == "constant"
jsonpath "$.report_ready" == false

Change it without stopping (live tuning below):

# Halve the rate while it runs; the change is logged with the run time.
PATCH {{harness_url}}/_rustybin/harness/runs/{{run_id}}
Authorization: Bearer {{admin_token}}
Content-Type: application/json
{"rate_multiplier": 0.5}
HTTP 200
[Asserts]
jsonpath "$.applied" == "rate x0.5"
jsonpath "$.controls.version" == 1
jsonpath "$.controls.multiplier" == 0.5
jsonpath "$.controls.log[0].what" == "rate x0.5"

The report exists once the run has drained:

GET {{harness_url}}/_rustybin/harness/runs/{{run_id}}/report
HTTP 409
[Asserts]
jsonpath "$.error" == "the run has not finished"
jsonpath "$.state" == "running"
# Poll the run until report_ready (or read the feed at .../events).
GET {{harness_url}}/_rustybin/harness/runs/{{run_id}}
[Options]
retry: 30
retry-interval: 500
HTTP 200
[Asserts]
jsonpath "$.state" == "finished"
jsonpath "$.report_ready" == true
jsonpath "$.passed" == true
GET {{harness_url}}/_rustybin/harness/runs/{{run_id}}/report
HTTP 200
[Asserts]
jsonpath "$.state" == "finished"
jsonpath "$.passed" == true
jsonpath "$.exit_code" == 0
jsonpath "$.totals.sent" >= 40
jsonpath "$.totals.not_sent" == 0
jsonpath "$.totals.gateway" == 0
jsonpath "$.totals.lost" == 0
jsonpath "$.totals.statuses['200']" >= 40
jsonpath "$.latency.p99_ms" < 500
jsonpath "$.overhead.count" >= 40
jsonpath "$.server.arrivals" >= 40
jsonpath "$.server.changes.headers_changed" == 0
jsonpath "$.saturation.saturated" == false
jsonpath "$.thresholds" count == 3
jsonpath "$.thresholds[*].pass" not contains false
jsonpath "$.changes[0].what" == "rate x0.5"
jsonpath "$.stages[0].type" == "constant"
jsonpath "$.samples[0].request_id" startsWith "{{run_id}}-"
jsonpath "$.timeline" count >= 3

The same report as text (?format=text) and as JUnit (?format=junit, one test case per threshold, for CI):

GET {{harness_url}}/_rustybin/harness/runs/{{run_id}}/report?format=text
HTTP 200
[Asserts]
header "Content-Type" contains "text/plain"
body contains "Classes:"
body contains "Latency (ms)"
body contains "Result: PASS (exit code 0)"
GET {{harness_url}}/_rustybin/harness/runs/{{run_id}}/report?format=junit
HTTP 200
[Asserts]
header "Content-Type" contains "xml"
xpath "string(//testsuite/@failures)" == "0"
xpath "count(//testcase)" == 4
GET {{harness_url}}/_rustybin/harness/runs
HTTP 200
[Asserts]
jsonpath "$.runs[0].run_id" == "{{run_id}}"
jsonpath "$.runs[0].state" == "finished"
jsonpath "$.active" == null

A node keeps its last runs in memory (and every report in RUSTYBIN_HARNESS_REPORT_DIR when set, named after the run id; an id is 1 to 64 letters, digits, ., _ or -, and a cluster part with any other id is refused). The kill switch stops all load on the node at once, whatever started it. It clears once 200 ms pass without another press, so the next run may start; a run that was still being prepared when it was pressed (resolving, fetching tokens or verifying its targets) never starts, however long the preparation takes:

POST {{harness_url}}/_rustybin/harness/stop
Authorization: Bearer {{admin_token}}
HTTP 200
[Asserts]
jsonpath "$.kill_switch" == true
jsonpath "$.stopped" count == 0

From the command line

The same engine runs as a command. --local-server starts an in-process Rustybin, loops the scenario through it and allows it as a target, which is the quickest way to try a scenario or to smoke test a build:

rustybin harness validate smoke.yaml
# Loop the scenario through an in-process Rustybin (the target is replaced by
# it and allowed automatically); the JSON report lands in report.json and the
# exit code is the report's: 0 when the thresholds pass, 1 when they fail.
rustybin harness run smoke.yaml --local-server --threads 1 --quiet --report report.json
rustybin harness report report.json --format junit

rustybin harness run scenario.yaml --target https://gateway.example.com --targets gateway.example.com sends to a real gateway (the allowlist comes from --targets or RUSTYBIN_HARNESS_TARGETS); --max-rate, --max-inflight, --max-duration and --threads override the caps, --verify requires the verification token, --format picks text, JSON or JUnit. The exit code is the report's: 0 when the thresholds pass, 1 when they fail, 2 on an error.

Headless, from the environment

A node can run one scenario at startup and exit with its code, which fits a job in a pipeline or a scheduler:

RUSTYBIN_HARNESS=on RUSTYBIN_HARNESS_ROLES=client RUSTYBIN_HARNESS_TARGETS=gateway.internal \
RUSTYBIN_HARNESS_SCENARIO=gateway-load.yaml RUSTYBIN_HARNESS_START=immediately \
RUSTYBIN_HARNESS_REPORT=report.json RUSTYBIN_HARNESS_EXIT=true rustybin

RUSTYBIN_HARNESS_REPORT=- prints the JSON report on stdout. On a coordinator, RUSTYBIN_HARNESS_START=on-quorum waits until the nodes the scenario asks for have joined (a cluster below).

From an agent or the console

The management MCP server has a tool per step (harness_status, validate_scenario, preview_scenario, import_traffic, import_scenario, create_run, get_run, update_run, get_run_report, the cluster tools) and a prompt, load_test_gateway, that walks an agent from the allowlist to a dry run and the real one; starting load always asks for confirmation. The console's Harness view has the scenario builder generated from the schema with a preview chart, the live run with its charts and controls, the cluster and leader cards, and the report.

What the report says

Every answer is in one class, and the classes add up to what was sent:

ClassMeaning
upstreamThe answer came from a Rustybin server node (it carries the served-by tag and Server-Timing); its status is whatever the upstream sent, so a 4xx here is the upstream's
gatewayThe answer did not come from the upstream: the gateway made it (a 429, a 503, an auth refusal, a cached answer); gateway_statuses counts them by status and limited is the 429s
transportA connection error or a timeout, by kind; transport_after_upstream says how many of them the upstream had seen anyway
lostSent, never answered, and the server side never saw it: the request died inside the gateway
not_sentThe client could not send on time (saturation), never counted against the gateway
unattributedAnswers that cannot carry the tag (gRPC, a WebSocket upgrade outside a Rustybin server's layer)
abandonedRequests the scenario's faults cancelled on purpose

Latency comes in several measures: from the intended send time (coordinated omission corrected: a late send counts the delay), from the actual send, the upstream's own processing time (Server-Timing), and overhead, the difference, which is the gateway's cost per request; in loop-through mode the request and response legs are measured on one clock. The server side counts arrivals by node, route and layer, what the gateway changed (headers added, removed and rewritten, bodies, paths) and how many captures were sampled into the inspector. saturation says whether the client itself was the bottleneck (in-flight cap, scheduler lag, CPU) so a slow number is never blamed on the gateway by mistake. Then the timeline per second, every stage as it ran, the live changes, the findings of the closed loops, the thresholds with their measured values, breakdowns by layer, target, operation and credential, the rate-limit analysis, stream statistics, and samples (the slowest, one of every class) with their X-Request-Id and traceparent to look up in the gateway's logs.

Patterns

A layer's pattern says how hard it pushes over time. Every pattern of the table takes jitter and sync, and chains with then:. The built-in ramp-to-target ramps, holds and keeps a probe alongside:

# Grow the load, then hold it: where does latency bend, and does the gateway
# keep up once the rate is steady? Two layers: the ramp and a probe that keeps
# a low, constant rate so the hold can be compared against an unloaded baseline.
name: ramp-to-target
description: Ramp from 10 to 500 requests per second over a minute, hold for two minutes, with a 1 rps probe alongside.
targets:
  - url: http://127.0.0.1:8080
    weight: 1
scale:
  virtual_clients: 50
layers:
  - name: customers
    source:
      requests:
        - path: /status/200
          weight: 8
        - method: POST
          path: /echo/{{vu}}
          headers:
            X-Rustybin-Seq: "{{seq}}"
          body:
            order: "{{seq}}"
            client: "{{vu}}"
          weight: 2
    pattern:
      type: ramp
      from: 10
      to: 500
      over: 1m
      then:
        type: constant
        rate: 500
        for: 2m
  - name: probe
    source:
      request:
        path: /status/200
    pattern:
      type: constant
      rate: 1
      for: 3m
timeout: 10s
thresholds:
  error_rate: 0.01
  latency_p99_ms: 1000
  min_achieved: 0.98
  saturated: false

step climbs plateaus and reports each one; spike rises, holds and falls then measures the recovery; pulse and burst make bursts land on the gateway at once from every client node (sync: cluster, the default) or spread (sync: node); wave follows a daily curve. Two patterns are closed loops: target with overhead_p99_ms moves the rate every second toward a gateway overhead goal, and breakpoint grows the rate plateau by plateau until an until condition (error rate, latency, overhead) fails and reports the last good rate:

# Find the highest rate the gateway sustains: plateaus 25 percent apart,
# each held for 10 seconds, until one fails a threshold. The run then stops
# and the report's findings name the last good rate.
name: breakpoint
description: Grow from 50 requests per second by 25 percent every 10 seconds, up to 5000, until errors pass 1 percent or the p99 latency passes 500 ms.
targets:
  - url: http://127.0.0.1:8080
    weight: 1
scale:
  virtual_clients: 100
layers:
  - name: main
    source:
      request:
        path: /status/200
    pattern:
      type: breakpoint
      start: 50
      growth: 0.25
      every: 10s
      max: 5000
      until:
        error_rate: 0.01
        latency_p99_ms: 500
timeout: 5s

A closed model: closed layer runs users with a think_time instead of a rate; the report then shows users and the rate they produced.

Rate-limit tests

A layer's expect describes what the gateway's limiter should do with its traffic, and the limit_test pattern probes it for a known weak spot. The built-in rate-limit scenario sends bursts around the window boundaries of a limit of 100 per minute next to legitimate customers that must never be refused:

# A rate-limit test next to legitimate traffic: heavy_user bursts around
# the limiter's window boundaries (a fixed window admits both bursts), then
# sends at half its limit to show the recovery, while customers stay under
# their own limit and must never be refused (collateral damage). Set the
# gateway's limit for the apikey test-key to 100 per minute.
name: rate-limit
description: window_edge against a limit of 100 per minute next to legitimate customers, with the rate-limit analysis.
targets:
  - url: http://127.0.0.1:8080
    weight: 1
scale:
  virtual_clients: 50
layers:
  - name: customers
    source:
      request:
        path: /status/200
        headers:
          apikey: customer-key
    pattern:
      type: constant
      rate: 1
      for: 5m
    thresholds:
      rate_limited: 0
  - name: heavy_user
    source:
      request:
        path: /status/200
        headers:
          apikey: test-key
    pattern:
      type: limit_test
      test: window_edge
      cycles: 2
      recover: 30s
    expect:
      limit: 100
      window: 1m
      per: key
    thresholds:
      over_admission: 0.02
timeout: 10s

The tests are over_limit, window_edge, just_under, distributed (from every client node at once, for counters local to each gateway node), many_keys, many_ips, retry_wave, concurrency, slow_rise and limit_probe (a binary search for the effective limit when nobody wrote it down; the built-in limit-probe scenario). The report's rate_limits section has, per layer: admitted, refused and failed requests; admission per window and in the worst window-long span, as over- or under-admission against expect; the time to the first refusal and the requests admitted before it; the recovery; the window as measured; breakdowns per identity and per gateway node; the rate-limit headers (RateLimit, RateLimit-Policy, X-RateLimit-*, Retry-After) and whether they say what expect says; upstream protection (what reached the server side against what was admitted); collateral damage on the other layers; and findings in words, such as "the fixed window admitted 196 of 100 across the boundary at 0:59". A layer's thresholds (rate_limited, over_admission, under_admission) fail the run like the run's own.

Traffic from mocks, identities, protocols and faults

A layer's source can be an OpenAPI mock deployed on the client node (source: {mock: petstore}): every operation with generated parameters and bodies, weights per operation, an invalid_fraction of requests that expect a 4xx (the report says how many got through anyway), and stateful: true for create-then-read pairs. The built-in petstore-customers scenario is the example. identities give each virtual client a credential: api_keys (listed or minted by name), jwt (minted by the node's built-in identity provider, RS256 with its JWKS or the HS256 demo secret), oauth (client credentials against the gateway's token endpoint, fetched before the run), forwarded (addresses in X-Forwarded-For) and source_addresses; the report breaks the answers down by operation and by credential label, never showing a secret.

llm sources stream chat completions from the mock LLM through the gateway and measure the time to the first token, the gaps between tokens and tokens per second (the built-in llm-streaming); sse, websocket, grpc and mcp do the same for event streams, sessions, unary calls and tool calls, in the report's streams section.

The faults block (and the live change faults) injects what real clients and upstreams do: a preset (calm, jittery, flaky-upstream, retries, synchronised, churn, all) plus overrides. Client faults are drawn per request by fraction: connection churn, abandoned requests, slow bodies, malformed JSON, wrong content types, oversized headers, retries on 5xx (immediate, or synchronised across the nodes to the next whole second), expired tokens and an HTTP/2 mix. Server faults travel to the server nodes with the run and act on the run's own requests at /harness/* and on /health: drops after the headers, stalls, a flapping health check and node churn, where the server nodes go down in turn, which exercises the gateway's health checks and circuit breakers. The built-ins flaky-upstream and jittery-clients show them:

# A flaky upstream behind the gateway: the server nodes drop 2 percent of
# the answers after the headers, stall 1 percent for 5 seconds (past the
# client's timeout), and /health flaps down for 5 seconds every 30. The
# gateway's retries, timeouts, health checks and circuit breakers show in
# what the clients see.
name: flaky-upstream
description: 50 requests per second for two minutes to the shaped endpoint, with the flaky-upstream fault preset on the server nodes.
targets:
  - url: http://127.0.0.1:8080
    weight: 1
scale:
  virtual_clients: 100
layers:
  - name: main
    source:
      request:
        path: /harness/orders
    pattern:
      type: constant
      rate: 50
      for: 2m
servers:
  latency:
    p50: 20ms
    p99: 100ms
faults:
  preset: flaky-upstream
thresholds:
  error_rate: 0.05
timeout: 3s

The tables of every parameter are in configuration.

HTTP/3 targets

A target with http: h3 is sent to over HTTP/3 (QUIC), for a gateway that terminates it:

targets:
  - url: https://gateway.internal:8443
    http: h3

It needs a build with the cargo feature harness-http3: the published image whose tag ends in -http3 (ghcr.io/coldbathcode/rustybin:latest-http3, or X.Y.Z-http3 for a release), or your own build (cargo build --release --features harness-http3, or docker build --build-arg CARGO_FEATURES="quota-postgres harness-http3"). The default binary and the default image carry no QUIC stack: they know the parameter (it is in the schema, the console form and the tools' schemas in every build) and refuse the scenario at validation with a message that names the feature. GET /_rustybin/harness answers http3: true on a build that has it, false on one that has not. In a cluster every node that sends runs the variant.

The variant is signed like the default image and verified the same way, by its own tag:

cosign verify ghcr.io/coldbathcode/rustybin:latest-http3 \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  --certificate-identity-regexp '^https://github.com/coldbathcode/rustybin/'

Nothing about where load may go changes with the protocol. The allowlist entry's port is the UDP port; the name is resolved once and QUIC connects to those pinned addresses only, with no Alt-Svc, no redirect, and no move to another address a server asks for; forbidden addresses are refused; with RUSTYBIN_HARNESS_VERIFY_TARGETS the target is verified over HTTP/3 (the TCP port of the same number may be another service); the kill switch stops it; TLS is verified unless the target says insecure. Every request carries the marker, and the report classes the answers (upstream, gateway, transport with its kinds) and measures the overhead as over HTTP/1 and 2.

HTTP/3 carries the plain HTTP sources (request, requests, a mock). The protocol sources, the faults connection_churn and http2, and identities.source_addresses are refused with an h3 target, by name.

# Whether this build sends HTTP/3 (the cargo feature harness-http3).
GET {{harness_url}}/_rustybin/harness
HTTP 200
[Asserts]
jsonpath "$.http3" isBoolean

# The parameter is known to every build; one without the feature answers
# valid: false with a problem that names the feature. HTTP/3 is always TLS.
POST {{harness_url}}/_rustybin/harness/validate
Content-Type: application/json
{
  "name": "over-quic",
  "targets": [{"url": "https://gateway.internal:8443", "http": "h3"}],
  "source": {"request": {"path": "/status/200"}},
  "pattern": {"type": "constant", "rate": 50, "for": "10s"}
}
HTTP 200
[Asserts]
jsonpath "$.scenario.targets[0].http" == "h3"

POST {{harness_url}}/_rustybin/harness/validate
Content-Type: application/json
{
  "name": "plain",
  "targets": [{"url": "http://gateway.internal:8080", "http": "h3"}],
  "source": {"request": {"path": "/status/200"}},
  "pattern": {"type": "constant", "rate": 50, "for": "10s"}
}
HTTP 200
[Asserts]
jsonpath "$.valid" == false
jsonpath "$.problems[*]" includes "targets[0].http: h3 needs an https target (HTTP/3 is always TLS)"

A hop of a server-to-server chain takes http: h3 too, in the same builds.

Server-to-server chains

A request through a gateway often goes on: the service it reaches calls another service, through the gateway again. servers.chain makes the harness's server side do the same, so a run measures every leg: the server that answers a client's request calls the first hop, the server that answers that call the second, and so on.

servers:
  chain:
    hops:
      - url: https://gateway.internal
        path: /orders          # the route that reaches the next server
      - url: https://gateway.internal
        path: /stock
    timeout: 5s                # per onward call (default 5s, at most 30s)
    max_concurrent: 64         # onward calls in flight per run on a server node

A hop is a gateway URL plus the one path the call asks for (default /), with host, http (auto, h1, h2, h2c, or h3 in a build with HTTP/3) and insecure as a target has them. The onward call is a GET with the harness's own headers and no body.

This is the only traffic the server role sends, so it has rules of its own, and nothing turns it on except a scenario that declares a chain:

  • Only the run's own requests. A server calls on only for a request that carries its run's signed marker. A request without one, with a marker of another run, or with a signature that does not verify is answered as an ordinary request and makes no call.
  • Only while the run is live. When the run ends, or the kill switch is pressed, the calls stop at once, those under way included. In a cluster a server calls on only on its leader's word that the run is sending, renewed like a client's lease, so a lost leader leaves no server calling. A marker replayed after the run calls nothing.
  • Only to the hops the scenario names. Nothing of the incoming request (address, host, path, query, headers, body) chooses where the next call goes or travels with it.
  • Checked like a target. Every hop must be allowed by RUSTYBIN_HARNESS_TARGETS on the server node, is resolved once and pinned, is never a link-local or metadata address or a control plane, and, with RUSTYBIN_HARNESS_VERIFY_TARGETS, must serve the verification token. A chain is prepared whole or not at all: a single node refuses the run (403, the problems by hop), a cluster's server node that cannot prepare it makes no call and the report says why.
  • A fixed depth, no loops. At most 3 hops, never the same one twice. The hop count travels inside the marker's signature, so it cannot be changed on the way, and a server calls on at most once for a request at a hop: a gateway's retry, a mirrored or a replayed request calls nothing a second time. A run's onward calls never exceed the requests its clients sent times the hops.
  • Bounded. max_concurrent calls in flight per run on a node; one over it is refused, not queued. Each call has its timeout. A run follows the first 16,777,216 requests of each hop.

The preview (POST /_rustybin/harness/preview) and the summary of a validation list the hops before anything is sent:

# A chain of two hops: the preview names where the server side will call,
# before anything is sent.
POST {{harness_url}}/_rustybin/harness/preview
Content-Type: application/json
{
  "name": "two-hops",
  "target": "{{harness_url}}",
  "source": {"request": {"path": "/harness/front"}},
  "pattern": {"type": "constant", "rate": 20, "for": "2s"},
  "servers": {"chain": {"hops": [
    {"url": "{{harness_url}}", "path": "/harness/orders"},
    {"url": "{{harness_url}}", "path": "/harness/stock"}
  ]}}
}
HTTP 200
[Asserts]
jsonpath "$.chain.calls_per_request" == 2
jsonpath "$.chain.hops[0].hop" == 1
jsonpath "$.chain.hops[0].url" == "{{harness_url}}/harness/orders"
jsonpath "$.chain.hops[1].called_by" == "the server answering hop 1"

A hop outside the allowlist refuses the run:

# A hop is checked like a target: one outside RUSTYBIN_HARNESS_TARGETS
# refuses the run before anything is sent.
POST {{harness_url}}/_rustybin/harness/runs
Authorization: Bearer {{admin_token}}
Content-Type: application/json
[Options]
retry: 10
retry-interval: 300
{
  "name": "elsewhere",
  "target": "{{harness_url}}",
  "source": {"request": {"path": "/harness/front"}},
  "pattern": {"type": "constant", "rate": 20, "for": "2s"},
  "servers": {"chain": {"hops": ["http://10.255.255.1:9"]}}
}
HTTP 403
[Asserts]
jsonpath "$.error" == "a chain hop is not allowed or not verified on this node"
jsonpath "$.problems[0]" contains "servers.chain.hops[0].url"
jsonpath "$.problems[0]" contains "RUSTYBIN_HARNESS_TARGETS"

The report's server.chain has one entry per hop: the calls made, how they were answered (upstream: by a server of the run, its tag verified; gateway: answered without it; transport by kind), the latency of the leg, the next server's processing time (upstream_latency) and the difference (overhead, the gateway's part of the leg), the arrivals of that hop, and refused: the requests that made no call, by reason (not_live, kill_switch, seen_before, untracked, busy, not_prepared). A server's processing time includes its onward call, as a real service's would, so the client's upstream_latency holds the legs behind it. An onward call is counted with its hop and not with server.arrivals, so lost and upstream_reach keep describing what the clients sent.

# The run: every request the node answers calls the first hop, whose
# answer calls the second.
POST {{harness_url}}/_rustybin/harness/runs
Authorization: Bearer {{admin_token}}
Content-Type: application/json
[Options]
retry: 10
retry-interval: 300
{
  "name": "two-hops",
  "target": "{{harness_url}}",
  "source": {"request": {"path": "/harness/front"}},
  "pattern": {"type": "constant", "rate": 20, "for": "2s"},
  "timeout": "2s",
  "servers": {"chain": {"hops": [
    {"url": "{{harness_url}}", "path": "/harness/orders"},
    {"url": "{{harness_url}}", "path": "/harness/stock"}
  ]}}
}
HTTP 202
[Captures]
chain_run: jsonpath "$.run_id"

GET {{harness_url}}/_rustybin/harness/runs/{{chain_run}}
[Options]
retry: 30
retry-interval: 500
HTTP 200
[Asserts]
jsonpath "$.report_ready" == true

# The report: one leg per hop. The clients' requests are still the only
# arrivals, so lost and upstream_reach mean what they did.
GET {{harness_url}}/_rustybin/harness/runs/{{chain_run}}/report
HTTP 200
[Asserts]
jsonpath "$.totals.sent" >= 30
jsonpath "$.server.arrivals" >= 30
jsonpath "$.server.chain.hops" count == 2
jsonpath "$.server.chain.hops[0].url" == "{{harness_url}}/harness/orders"
jsonpath "$.server.chain.hops[0].calls" >= 30
jsonpath "$.server.chain.hops[0].upstream" >= 30
jsonpath "$.server.chain.hops[0].gateway" == 0
jsonpath "$.server.chain.hops[0].transport" == 0
jsonpath "$.server.chain.hops[0].latency.p50_ms" > 0
jsonpath "$.server.chain.hops[1].calls" >= 30
jsonpath "$.server.chain.hops[1].arrivals" >= 30
jsonpath "$.server.chain.hops[1].refused.seen_before" not exists

A dashboard sees the onward calls while the run is on: /_rustybin/metrics has the counter rustybin_harness_chain_calls_total{run, hop, result} on every server node, for the calls that node made (a cluster's total is the sum over its server nodes, as in the merged report).

LabelValues
runthe run's id; like every rustybin_harness_* series, the active run plus the last 4
hop1 to 3, the report's hop
resultok: the call was answered, whatever the status (the report's upstream plus gateway); failed: no answer, such as a refused connection or the timeout (the report's transport without stopped); or why a request made no call, or a call under way was ended: not_prepared, not_live, kill_switch, seen_before, untracked, busy (the report's refused)

The series is fed by the counts the report sums, so at the end of a run the two agree. A value appears once it is counted: a run without a chain has no such series, and neither has a result that never happened, so write sum(rate(...)) rather than expect a zero. With the kill switch pressed kill_switch rises and ok stops. An onward call's arrival is in no series: rustybin_harness_server_arrivals_total keeps counting the clients' requests only. There is no latency histogram per hop; the report has the legs.

# The same calls as a Prometheus series, by run, hop and result, scraped
# while the run is on or after it.
GET {{harness_url}}/_rustybin/metrics
Authorization: Bearer {{admin_token}}
HTTP 200
[Asserts]
body contains "# TYPE rustybin_harness_chain_calls_total counter"
body contains "rustybin_harness_chain_calls_total{run=\"{{chain_run}}\",hop=\"1\",result=\"ok\"}"
body contains "rustybin_harness_chain_calls_total{run=\"{{chain_run}}\",hop=\"2\",result=\"ok\"}"

A hop over HTTP/3

A mesh whose inner hops speak HTTP/3 is tested end to end with http: h3 on a hop:

servers:
  chain:
    hops:
      - url: https://mesh.internal:8443
        http: h3
        path: /orders

It needs the build with HTTP/3 on the server nodes, which make the call; a build without the cargo feature harness-http3 refuses the scenario at validation with a message that names the feature, as for a target, and a server node of a cluster that lacks it makes no call and says so in server.chain.problems. Chains may be mixed: the clients' target over HTTP/1 or 2 with a hop over HTTP/3, or the reverse.

Every rule of a chain holds as it is: the signed marker, the run being live, one bodiless GET per request and hop, the fixed depth, max_concurrent and the timeout, the legs in the report and the rustybin_harness_chain_calls_total series. And every fence of an HTTP/3 target holds for the hop: the allowlist entry's port is the UDP port, the hop's name is resolved once on the server node and QUIC connects to those pinned addresses only, with no Alt-Svc, no redirect and no move to another address the hop's server asks for; with RUSTYBIN_HARNESS_VERIFY_TARGETS the hop is verified over HTTP/3; TLS is verified unless the hop says insecure. A hop keeps at most 8 QUIC connections, as a target does. They are closed when the kill switch is set and when the run is no longer live, calls under way included (the report counts those as stopped, under kill_switch or not_live), and for good when the run ends.

# A chain whose inner hop speaks HTTP/3: the clients reach the gateway over
# TCP, the server that answers calls on over QUIC. A build with the feature
# answers valid: true; one without it names the feature, as for a target.
POST {{harness_url}}/_rustybin/harness/validate
Content-Type: application/json
{
  "name": "mesh-over-quic",
  "target": "https://gateway.internal",
  "source": {"request": {"path": "/harness/front"}},
  "pattern": {"type": "constant", "rate": 50, "for": "10s"},
  "servers": {"chain": {"hops": [
    {"url": "https://mesh.internal:8443", "http": "h3", "path": "/orders"}
  ]}}
}
HTTP 200
[Asserts]
jsonpath "$.scenario.servers.chain.hops[0].http" == "h3"
jsonpath "$.summary.chain" count == 1

# A hop over HTTP/3 is always TLS, in every build.
POST {{harness_url}}/_rustybin/harness/validate
Content-Type: application/json
{
  "name": "plain-hop",
  "target": "https://gateway.internal",
  "source": {"request": {"path": "/harness/front"}},
  "pattern": {"type": "constant", "rate": 50, "for": "10s"},
  "servers": {"chain": {"hops": [
    {"url": "http://mesh.internal:8080", "http": "h3"}
  ]}}
}
HTTP 200
[Asserts]
jsonpath "$.valid" == false
jsonpath "$.problems[*]" includes "servers.chain.hops[0].http: h3 needs an https hop (HTTP/3 is always TLS)"

OpenTelemetry

Set harness.otlp_endpoint (Management, or rustybin settings set) to a collector's HTTP base URL and each finished run is sent to its /v1/metrics, as OTLP over HTTP with a JSON body: sent, completed, ok, transport errors, lost, the p50 and p99 latency, the achieved rate and whether the run passed, labelled with the run, the scenario and its state. The secret harness.otlp_token goes along as a bearer token when your collector wants one. A cluster's run is sent once, by the leader, merged.

Only those numbers and names go out, never a target, a header or a body. A task sends them after a run has ended, so a slow collector cannot touch a run, and one that is down costs a warning in the log, since the report still holds everything.

Replaying a recording

A HAR file from a browser or a proxy, or the captures of GET /_rustybin/requests, can become a scenario's source: POST /_rustybin/harness/import, rustybin harness import <file>, the import_traffic tool, or the file field of the console's builder. Identical requests turn into one template with their count as its weight (scaled when one passes 1000, the proportions kept), so the replay keeps the recording's mix; the 64 most frequent are kept, as many as a layer takes. Nothing is sent: put the answer's source in a scenario, which then meets the same validation and allowlist as any other, and name your own target, since the recording's hosts are dropped.

A recording holds credentials and a scenario gets shared, so a secret-looking header or query parameter is removed and named in removed, and an entry with a secret-looking field in its body is left out and counted in skipped. Add the credentials your target needs through an identity, never by hand into the file.

# A recording as a scenario's source: the token is removed and named.
POST {{harness_url}}/_rustybin/harness/import
Authorization: Bearer {{admin_token}}
{"log": {"entries": [
  {"request": {"method": "GET", "url": "https://api.example.com/orders?token=abc&page=2", "headers": []}, "response": {"status": 200}},
  {"request": {"method": "GET", "url": "https://api.example.com/orders?token=abc&page=2", "headers": []}, "response": {"status": 200}}
]}}
HTTP 200
[Asserts]
jsonpath "$.source.requests[0].path" == "/orders?page=2"
jsonpath "$.source.requests[0].weight" == 2
jsonpath "$.removed[0]" == "token"

Importing a Postman collection or an Artillery script

The same import reads two formats other tools write: a Postman collection (v2.1, as the app exports it) and an Artillery script (YAML or JSON). The format is read from the document; ?format=har|captures|postman|artillery (--format on the command line, format of the import_scenario tool) names it instead. It is still an import: the answer's source goes into a scenario that names its own target and meets the same validation and allowlist as a hand-written one.

Other tools say more than a request list, and only what has an exact counterpart is taken:

FromTakenNamed in left_out, never run
A Postman collectionFolders (16 deep), each request's method, path, enabled query parameters and headers, the body modes raw, urlencoded and graphql, collection variablesevent (pre-request and test scripts), auth at every level, protocolProfileBehavior; a formdata or file body leaves its request out
An Artillery scriptconfig.target (its path leads the requests), config.defaults.headers, config.variables with one value, config.http.timeout (as timeout), each scenario's weight, the request steps with url, qs, headers, json, body, form and the statusCode of an expectconfig.processor and every function, beforeRequest, afterResponse, beforeScenario, afterScenario (code), config.plugins, payload, environments, ensure, tls, capture, match, think, loop, parallel, log, scenarios of another engine; ifTrue and formData leave their request out

An Artillery script's phases become pattern when the pattern model says the same thing: arrivalRate is a constant stage, with rampTo a linear ramp, arrivalCount a constant at the count over the duration, pause a constant at 0. An Artillery phase counts arrivals and each arrival runs one flow, so a stage's rate is the arrivals times the weighted requests per flow (notes says the number). The phases are all or nothing: a maxVusers, a value that is not a number, more than 16 phases, a flow with think, loop, parallel, function or ifTrue, or a request that was left out, and pattern is absent with the reason in left_out.

Variables ({{name}} in both formats): one the document defines with a single plain value is put in. Any other (an environment variable, a captured value, {{$guid}}) is never guessed: its request is left out, counted in skipped, and the name is listed in variables. Define it in the collection or the script, or give its value with the import, one by one or as the collection's environment file. A variable whose name looks secret is never put in, and credentials are removed as for a recording.

A program in a scripting language (a k6 or Locust script, an Artillery processor) is refused with 400: nothing here runs or translates code. A collection or a script is at most 4 MiB, and at most 64 different requests are kept, the most frequent ones, since that is what a layer takes.

# A Postman collection (v2.1): the path variable with a value is put in, the
# test script and the bearer token are named and left out, and the request
# whose variable has no value is left out too.
POST {{harness_url}}/_rustybin/harness/import
Authorization: Bearer {{admin_token}}
{"info": {"name": "Orders", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},
 "auth": {"type": "bearer", "bearer": [{"key": "token", "value": "abc"}]},
 "item": [
  {"name": "One order", "event": [{"listen": "test", "script": {"exec": ["pm.test('ok', () => {})"]}}],
   "request": {"method": "GET", "header": [{"key": "Accept", "value": "application/json"}],
    "url": {"raw": "https://api.example.com/v2/orders/:id?page=2", "protocol": "https", "host": ["api", "example", "com"],
     "path": ["v2", "orders", ":id"], "query": [{"key": "page", "value": "2"}], "variable": [{"key": "id", "value": "42"}]}}},
  {"name": "A customer", "request": {"method": "GET", "header": [],
    "url": {"raw": "https://api.example.com/v2/customers/:customer", "protocol": "https", "host": ["api", "example", "com"],
     "path": ["v2", "customers", ":customer"]}}}
 ]}
HTTP 200
[Asserts]
jsonpath "$.format" == "postman"
jsonpath "$.entries" == 2
jsonpath "$.source.requests" count == 1
jsonpath "$.source.requests[0].path" == "/v2/orders/42?page=2"
jsonpath "$.left_out" includes "collection.auth (bearer)"
jsonpath "$.left_out" includes "item[0].event (scripts)"
jsonpath "$.variables[0]" == ":customer"
jsonpath "$.hosts[0]" == "api.example.com"
# An Artillery script (here as JSON; YAML is read too): two phases become a
# pattern, at 2 requests per arrival, and the processor is named, never run.
POST {{harness_url}}/_rustybin/harness/import?format=artillery
Authorization: Bearer {{admin_token}}
{"config": {"target": "https://api.example.com", "processor": "./functions.js",
  "phases": [{"duration": 60, "arrivalRate": 5}, {"duration": 120, "arrivalRate": 5, "rampTo": 20}]},
 "scenarios": [{"flow": [
  {"get": {"url": "/orders"}},
  {"post": {"url": "/orders", "json": {"item": "tea"}}}
 ]}]}
HTTP 200
[Asserts]
jsonpath "$.format" == "artillery"
jsonpath "$.source.requests" count == 2
jsonpath "$.pattern.type" == "constant"
jsonpath "$.pattern.rate" == 10.0
jsonpath "$.pattern.then.type" == "ramp"
jsonpath "$.pattern.then.to" == 40.0
jsonpath "$.left_out" includes "config.processor (code, never run)"
jsonpath "$.hosts[0]" == "api.example.com"

Giving the variables their values

A collection usually keeps its base URL and ids in an environment the exported file does not carry, so it can import as nothing: every request waits for a variable. Give the values with the import. On the API the body becomes an envelope, {"document": ..., "format": ..., "variables": {...}}, where document is the document or its text (a YAML script travels as text) and format is optional:

{
  "document": {
    "info": {
      "name": "Shop",
      "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "variable": [{ "key": "version", "value": "v1" }],
    "item": [
      {
        "name": "A customer's orders",
        "request": {
          "method": "GET",
          "header": [
            { "key": "Accept", "value": "application/json" },
            { "key": "Authorization", "value": "Bearer {{session}}" }
          ],
          "url": {
            "raw": "{{baseUrl}}/{{version}}/customers/{{customerId}}/orders?state={{state}}",
            "host": ["{{baseUrl}}"],
            "path": ["{{version}}", "customers", "{{customerId}}", "orders"],
            "query": [{ "key": "state", "value": "{{state}}" }]
          }
        }
      },
      {
        "name": "One order",
        "request": {
          "method": "GET",
          "header": [],
          "url": {
            "raw": "{{baseUrl}}/{{version}}/orders/:order",
            "host": ["{{baseUrl}}"],
            "path": ["{{version}}", "orders", ":order"]
          }
        }
      },
      {
        "name": "The invoice of an order",
        "request": {
          "method": "GET",
          "header": [],
          "url": {
            "raw": "{{baseUrl}}/{{version}}/orders/:order/invoices/{{invoiceId}}",
            "host": ["{{baseUrl}}"],
            "path": ["{{version}}", "orders", ":order", "invoices", "{{invoiceId}}"]
          }
        }
      }
    ]
  },
  "variables": {
    "baseUrl": "https://api.example.com/shop",
    "version": "v2",
    "customerId": 7,
    "state": "open",
    ":order": "o-42"
  }
}
# A collection whose base URL and ids live in an environment, in an envelope
# with their values (import-variables.json). The base URL's path leads the
# requests and its host is listed; the given version wins over the
# collection's own; the Authorization header is removed whatever it holds;
# the one variable that still has no value stays named, its request left out.
POST {{harness_url}}/_rustybin/harness/import
Authorization: Bearer {{admin_token}}
Content-Type: application/json
file,import-variables.json;
HTTP 200
[Asserts]
jsonpath "$.format" == "postman"
jsonpath "$.entries" == 3
jsonpath "$.source.requests" count == 2
jsonpath "$.source.requests[*].path" includes "/shop/v2/customers/7/orders?state=open"
jsonpath "$.source.requests[*].path" includes "/shop/v2/orders/o-42"
jsonpath "$.hosts[0]" == "api.example.com"
jsonpath "$.removed[0]" == "authorization"
jsonpath "$.variables" count == 1
jsonpath "$.variables[0]" == "invoiceId"
  • A name is written as the document writes it, without the braces: baseUrl for {{baseUrl}}, :order for a Postman path variable. A given value wins over the document's own (the collection above says version is v1).
  • A variable in the place of a Postman URL's host ({{baseUrl}}/orders) is a base URL: its host is listed in hosts and dropped as every host is, and its path leads the requests. Without a value it is dropped with the host, and notes says so.
  • The answer keeps naming what is still undefined in variables, every variable a left-out request needs, so one more round finishes the job. When nothing imports at all, the 400 carries the same variables list. A given variable the document never uses is named in notes.
  • Never a credential. A name that looks like one (token, apiKey, password) is refused, and a value that lands in a secret-looking header or query parameter is removed with it, as the document's own would be: the Authorization header above is gone whatever session holds. Give the scenario an identity instead. A value is never logged, never in the audit log and never in an error, which names the variable only.
  • A name the harness has a placeholder for. seq, vu, run, node, layer, rand, id and ip are the harness's own {{placeholders}}, and {{id}} is also the commonest variable a collection has. In an imported document it is always the document's variable, never the harness's: without a value its request is left out and the name listed in variables, like any other. Give it a value and it is put in like any other too, and notes names it (variables: a harness placeholder name was given a fixed value: id), because every imported request then carries that one constant where a hand-written {{id}} would get a new value for each request. To have the harness generate the value, write the placeholder into the scenario after the import. A value may still not hold {{, and a request whose text reads as a placeholder once the values are in is left out: an import never brings a placeholder in.
  • At most 64 variables, 1 KiB each, text, numbers or true and false. A recording has no variables: giving one with a HAR file or captures is refused.
  • Nothing about safety changes with a value: what comes out is still a scenario's source, validated and allowlisted like a hand-written one, and it still names its own target.
SurfaceHow
APIPOST /_rustybin/harness/import with the envelope {document, format, variables, environment}
ConsoleLoad test, the builder's file field: when the file leaves requests out for variables (or drops a host's variable), a form under it lists them, takes more rows (such as a base URL) and takes the collection's environment file, which fills the fields; Import again sends the same file with the values
Management MCPimport_scenario with variables, a map of name to value, and environment, the environment file or its text
CLIrustybin harness import shop.postman_collection.json --var baseUrl=https://api.example.com/shop --var :order=o-42 (repeatable), --environment staging.postman_environment.json
rustybin.yamlNothing: an import is a conversion, its result is a scenario

A Postman environment file as the variables

The values usually exist already, in the environment the collection is run with. Export it (the environment's menu, Export; a globals export has the same shape) and hand the file over instead of typing each variable. This collection keeps its base URL, an id and a region in its environment:

{
  "info": {
    "name": "Items",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "One item",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer {{session}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/items/{{id}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "items",
            "{{id}}"
          ]
        }
      }
    },
    {
      "name": "Its parts",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/items/{{id}}/parts?region={{region}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "items",
            "{{id}}",
            "parts"
          ],
          "query": [
            {
              "key": "region",
              "value": "{{region}}"
            }
          ]
        }
      }
    }
  ]
}
{
  "id": "5f0c2a52-7d0e-4c55-9a53-2f1f6f0f6a11",
  "name": "Staging",
  "values": [
    {
      "key": "baseUrl",
      "value": "https://api.example.com/shop",
      "type": "default",
      "enabled": true
    },
    {
      "key": "id",
      "value": "41",
      "type": "default",
      "enabled": true
    },
    {
      "key": "region",
      "value": "eu",
      "type": "default",
      "enabled": true
    },
    {
      "key": "region",
      "value": "us",
      "type": "default",
      "enabled": false
    },
    {
      "key": "session",
      "value": "kept-out-of-the-import",
      "type": "secret",
      "enabled": true
    }
  ],
  "_postman_variable_scope": "environment"
}

On the API the envelope takes it as environment, the document or its text, next to variables:

# The collection with its Postman environment file instead of each value.
# The entry marked secret is never taken (the header it stood in is removed
# anyway), the disabled one is passed over, and the collection's {{id}}, a
# name the harness has a placeholder for, is the constant the file gives:
# notes says both, by name.
POST {{harness_url}}/_rustybin/harness/import
Authorization: Bearer {{admin_token}}
Content-Type: application/json
file,import-environment.json;
HTTP 200
[Asserts]
jsonpath "$.format" == "postman"
jsonpath "$.source.requests" count == 2
jsonpath "$.source.requests[*].path" includes "/shop/items/41"
jsonpath "$.source.requests[*].path" includes "/shop/items/41/parts?region=eu"
jsonpath "$.hosts[0]" == "api.example.com"
jsonpath "$.removed[0]" == "authorization"
jsonpath "$.variables" count == 0
jsonpath "$.notes" count == 2
jsonpath "$.notes[0]" == "environment: not taken, marked secret (a credential is never taken): session"
jsonpath "$.notes[1]" startsWith "variables: a harness placeholder name was given a fixed value: id."
body not contains "kept-out-of-the-import"
rustybin harness import items.postman_collection.json --environment items.postman_environment.json
  • Every entry meets the checks a given variable meets, and the 64 count what is taken from the file together with what variables gives. A file is somebody's whole setup, so an entry that fails a check is not taken, and notes names it with the reason, where a variable you typed would be refused: the import goes on with the rest.
  • An entry marked secret is never taken: it is a credential. Nor is one whose name looks like a credential (token, apiKey), whatever its type. Both are named in notes, never their values. Give the scenario an identity instead, and export the environment without its secrets where you can: the file still travels to the instance.
  • A disabled entry ("enabled": false) is passed over, as the app passes over it. An entry without a value, or with one that is no variable's (over 1 KiB, holding {{ as a value built from another variable does, or not text, a number, true or false), is not taken and is named. When a name is listed twice, the last entry stands.
  • variables win over the file's entries, so one value can be changed without editing the file. An entry the document never uses is not reported: only a variable you typed is (it may be a typo).
  • An environment is at most 256 KiB and 1000 entries. One that is not an environment (not JSON, no values list, an entry without a key) is a 400 that quotes nothing of it, and more than 64 usable variables is a 400 too: disable the entries the collection does not use. A value is never logged, never in the audit log and never in an answer beyond the requests it was put in. A recording has no variables, from a file either.
  • In the console the form reads the file in the browser to fill the fields it lists (never from a secret or disabled entry) and sends the file with the import for the rest, such as a base URL.

Importing an Arazzo document

The import also reads an Arazzo 1.0 document (?format=arazzo, or read from the document): the steps of its workflows become request templates, each against the mock its source description is on this instance. A step's $statusCode criterion is the template's expect_status.

A scenario's requests are sent by weight, not as a journey, so nothing can be passed from one to the next: a step that needs a workflow input or an earlier step's output is left out, and the value is named in variables. A workflow input can be given with the import under the name variables shows (PETNAME for the input petName); an earlier step's output cannot, since only a run makes it. Load test the steps that stand alone here, and run the whole journey as a multi-step saved test. Both steps of the example document need a value, so the import says so:

POST {{base_url}}/_rustybin/harness/import
Authorization: Bearer {{admin_token}}
Content-Type: application/yaml
file,pets.arazzo.yaml;
HTTP 400
[Asserts]
jsonpath "$.error" contains "every request was left out"
jsonpath "$.error" contains "PETNAME"

Live tuning

PATCH .../runs/<run> changes a running run: rate_multiplier (0 to 10, the run or one layer), pause and resume, hold (freeze the pattern where it is) and false to release it, skip_stage, set ({"<layer>.pattern.<field>": value}, then. for the next stage), add_layer, remove_layer and faults. A change is checked like a new scenario (caps included), applied on the scheduler's next pass, on every client node of a cluster at once, logged with the run time it was made at, and carried in the cluster's snapshot, so it survives a failover. The report lists the changes and every stage as it ran, so a hold or a skip is visible next to its numbers.

A cluster

One node sends what one machine can. A cluster spreads a run over client nodes, puts server nodes behind the gateway, and merges one report. Nodes pull: they join a leader and heartbeat it (a long poll carrying their stats and clock stamps, returning assignments), so nodes behind NAT or in other networks work, and the leader never has to reach them.

  • The leader is the node a cluster was created on (RUSTYBIN_HARNESS_ROLES=coordinator with RUSTYBIN_HARNESS_CLUSTER and RUSTYBIN_HARNESS_JOIN_TOKEN, or POST /_rustybin/harness/clusters). It validates and splits a run by the clients' declared capacity, starts every client at the same instant on its clock, merges their histograms exactly (no averaged percentiles), and asks the server nodes after the run which failed requests they saw, so lost is exact across the cluster.
  • Client and server nodes join with the token (RUSTYBIN_HARNESS_JOIN=<leader>, or POST /_rustybin/harness/join). A client checks every assignment against its own caps and its own allowlist, so a leader cannot aim it anywhere its operator did not allow, and stops sending when no leader has renewed its lease (5 s by default).
  • GET .../clusters/<id>/upstreams lists the server nodes' advertised URLs (RUSTYBIN_HARNESS_ADVERTISE) for the gateway's upstream pool.
  • A run asks for its nodes with scale.client_nodes and scale.server_nodes; starting waits for that quorum (409 without it). client_nodes: auto lets the leader size the run from the clients' capacity and emit a signed scale_request to RUSTYBIN_HARNESS_SCALE_HOOK when more are needed; Rustybin never starts machines.

A node with the client or server role and the coordinator role joins its own cluster, so the cluster API works on one node too:

# A cluster led by this node. A node with the client or server role joins
# its own cluster, so one node is a cluster of one.
POST {{harness_url}}/_rustybin/harness/clusters
Authorization: Bearer {{admin_token}}
Content-Type: application/json
{"cluster_id": "docs-cluster", "join_token": "docs-cluster-join-token-0001"}
HTTP 201
[Asserts]
jsonpath "$.cluster_id" == "docs-cluster"
jsonpath "$.term" == 1
jsonpath "$.leader.node_id" == "docs-harness"
jsonpath "$.join_token" == "docs-cluster-join-token-0001"
jsonpath "$.members" count == 1
jsonpath "$.members[0].eligible" == true
jsonpath "$.alive.clients" == 1
jsonpath "$.alive.servers" == 1
jsonpath "$.failover" startsWith "unavailable"
jsonpath "$.links.join" == "/_rustybin/harness/clusters/docs-cluster/nodes"
GET {{harness_url}}/_rustybin/harness/clusters/docs-cluster/leader
HTTP 200
[Asserts]
jsonpath "$.leader.node_id" == "docs-harness"
jsonpath "$.leader.term" == 1
jsonpath "$.answered_by" == "docs-harness"
jsonpath "$.eligible" count == 1
jsonpath "$.history[0].reason" == "created"
GET {{harness_url}}/_rustybin/harness/clusters/docs-cluster/upstreams
HTTP 200
[Asserts]
jsonpath "$" count == 1
jsonpath "$[0]" == "{{harness_url}}"
# Submit (validated, not started), then start: the rate is split over the
# client nodes and every one of them starts at the same instant.
POST {{harness_url}}/_rustybin/harness/clusters/docs-cluster/runs
Authorization: Bearer {{admin_token}}
Content-Type: application/json
{
  "name": "cluster-run",
  "target": "{{harness_url}}",
  "source": {"request": {"path": "/status/200"}},
  "pattern": {"type": "constant", "rate": 20, "for": "3s"},
  "scale": {"virtual_clients": 4, "client_nodes": 1, "server_nodes": 1},
  "timeout": "2s"
}
HTTP 201
[Captures]
cluster_run: jsonpath "$.run_id"
[Asserts]
jsonpath "$.state" == "created"
jsonpath "$.quorum.met" == true
jsonpath "$.quorum.need_clients" == 1

POST {{harness_url}}/_rustybin/harness/clusters/docs-cluster/runs/{{cluster_run}}/start
Authorization: Bearer {{admin_token}}
HTTP 202
[Asserts]
jsonpath "$.state" == "starting"
jsonpath "$.start_at" exists
GET {{harness_url}}/_rustybin/harness/clusters/docs-cluster/runs/{{cluster_run}}/report
[Options]
retry: 40
retry-interval: 500
HTTP 200
[Asserts]
jsonpath "$.state" == "finished"
jsonpath "$.passed" == true
jsonpath "$.totals.sent" >= 40
jsonpath "$.cluster.cluster_id" == "docs-cluster"
jsonpath "$.cluster.term" == 1
jsonpath "$.cluster.lost_check" == "complete"
jsonpath "$.cluster.unreported" == 0
jsonpath "$.cluster.nodes[0].share" == 1
jsonpath "$.cluster.nodes[0].state" == "finished"
jsonpath "$.cluster.history" count == 1

DELETE {{harness_url}}/_rustybin/harness/clusters/docs-cluster
Authorization: Bearer {{admin_token}}
HTTP 204

The report's cluster section has every node with its share, its range of virtual clients, what it sent and saw, its clock offset and error bound and its start lag, the lost_check, any unreported bound and the history of leaders. Controller routes asked on a member that does not lead answer 307 to the leader with X-Rustybin-Harness-Leader, and GET .../leader is answered by every member, so a controller can talk to any node it knows.

The compose example

docs/examples/harness/cluster/ runs a whole cluster on one machine: a leader, a standby, two client nodes, two server nodes and a stand-in gateway (a plain reverse proxy over the two servers, gateway.conf; put the gateway under test there and point it at the upstream export).

cd docs/examples/harness/cluster
docker compose up --build --abort-on-container-exit --exit-code-from leader

The leader creates perf-1 at startup, waits for the two clients and two servers (RUSTYBIN_HARNESS_START=on-quorum), runs gateway-load.yaml through the gateway, prints the report and exits with its code. The scenario:

# The scenario the compose cluster runs (docs/src/harness.md): two client
# nodes ramp from 20 to 200 requests per second through the gateway and hold
# it, with a 2 rps probe alongside; the two server nodes answer. 40 seconds.
name: gateway-load
description: Ramp from 20 to 200 requests per second over 15 seconds through the gateway, hold for 25 seconds, with a probe alongside.
target: http://gateway
scale:
  virtual_clients: 40
  client_nodes: 2
  server_nodes: 2
layers:
  - name: customers
    source:
      requests:
        - path: /status/200
          weight: 8
        - method: POST
          path: /echo/{{vu}}
          headers:
            X-Rustybin-Seq: "{{seq}}"
          body:
            order: "{{seq}}"
            client: "{{vu}}"
          weight: 2
    pattern:
      type: ramp
      from: 20
      to: 200
      over: 15s
      then:
        type: constant
        rate: 200
        for: 25s
  - name: probe
    source:
      request:
        path: /status/200
    pattern:
      type: constant
      rate: 2
      for: 40s
timeout: 5s
thresholds:
  error_rate: 0.01
  latency_p99_ms: 1000
  min_achieved: 0.95

The compose file:

# A harness cluster in Docker Compose (docs/src/harness.md, "A cluster"):
# a leader, a standby, two client nodes, two server nodes and a stand-in
# gateway (a plain reverse proxy, gateway.conf) in front of the servers.
#
#   cd docs/examples/harness/cluster
#   docker compose up --build --abort-on-container-exit --exit-code-from leader
#
# The leader creates the cluster at startup, waits until the two clients and
# the two servers have joined, runs gateway-load.yaml through the gateway,
# prints the report and exits with the report's exit code (0: thresholds
# pass, 1: they fail, 2: an error); --abort-on-container-exit then stops the
# rest. Without --abort-on-container-exit the other nodes keep running and
# the report is at http://localhost:18900/_rustybin/harness/clusters/perf-1/runs
# (the leader has exited, so ask the standby on port 18901).
#
# The join token is a documentation value: set HARNESS_JOIN_TOKEN for your
# own. RUSTYBIN_IMAGE names an image built elsewhere (CI) instead of building.
# A cluster that sends HTTP/3 (a target or a chain hop with `http: h3`) runs
# the image variant with the suffix -http3 on every node, for example
# RUSTYBIN_IMAGE=ghcr.io/coldbathcode/rustybin:latest-http3: a node without a
# QUIC stack refuses the scenario by the feature's name.
# conformance/harness/run.sh runs this cluster and kills the leader mid-run.

x-node: &node
  image: ${RUSTYBIN_IMAGE:-rustybin:harness}
  environment: &node-env
    RUSTYBIN_LOG_LEVEL: ${RUSTYBIN_LOG_LEVEL:-info}
    # The demo reads the cluster's runs and report without credentials; a
    # real deployment keeps the default (the password sign-in) or jwt.
    RUSTYBIN_CONTROL_AUTH: open
    RUSTYBIN_HTTPS_PORT: "0"
    RUSTYBIN_GRPC_PORT: "0"
    RUSTYBIN_HARNESS: "on"
    RUSTYBIN_HARNESS_CLUSTER: perf-1
    RUSTYBIN_HARNESS_JOIN_TOKEN: ${HARNESS_JOIN_TOKEN:-compose-demo-join-token-change-me}
    RUSTYBIN_HARNESS_JOIN: http://leader
    RUSTYBIN_HARNESS_VERIFY_TARGETS: "true"
    # Engine threads: a container sees every host core, and a few threads
    # keep the scheduler lag low at these rates.
    RUSTYBIN_HARNESS_THREADS: "4"

services:
  leader:
    <<: *node
    build:
      context: ../../../..
    container_name: harness-leader
    environment:
      <<: *node-env
      RUSTYBIN_INSTANCE_ID: leader
      RUSTYBIN_HARNESS_ROLES: coordinator
      RUSTYBIN_HARNESS_JOIN: ""
      RUSTYBIN_HARNESS_CONTROL_URL: http://leader
      RUSTYBIN_HARNESS_ELECTION_TIMEOUT: 2s
      # Headless: run the scenario once the quorum (2 clients, 2 servers) is
      # there, print the report, exit with its code.
      RUSTYBIN_HARNESS_SCENARIO: /app/scenarios/gateway-load.yaml
      RUSTYBIN_HARNESS_START: on-quorum
      RUSTYBIN_HARNESS_REPORT: "-"
      RUSTYBIN_HARNESS_EXIT: "true"
    volumes:
      - ./gateway-load.yaml:/app/scenarios/gateway-load.yaml:ro
    # The run starts as soon as the quorum is there, and its target is the
    # gateway: the leader starts after it, so the name resolves by then. The
    # other nodes start first and keep trying to join until the leader is up.
    depends_on:
      - gateway
    ports:
      - "${HARNESS_LEADER_PORT:-18900}:80"

  # A standby: eligible to lead, first in the succession, no other work.
  standby:
    <<: *node
    container_name: harness-standby
    environment:
      <<: *node-env
      RUSTYBIN_INSTANCE_ID: standby
      RUSTYBIN_HARNESS_ROLES: coordinator
      RUSTYBIN_HARNESS_CONTROL_URL: http://standby
      RUSTYBIN_HARNESS_LEADER: prefer
    ports:
      - "${HARNESS_STANDBY_PORT:-18901}:80"

  # Two client nodes send the load; client-1 is also eligible to lead, so
  # the cluster has three eligible nodes (leader, standby, client-1) and a
  # majority exists after any one of them is lost.
  client-1:
    <<: *node
    container_name: harness-client-1
    environment:
      <<: *node-env
      RUSTYBIN_INSTANCE_ID: client-1
      RUSTYBIN_HARNESS_ROLES: client
      RUSTYBIN_HARNESS_TARGETS: gateway
      RUSTYBIN_HARNESS_CONTROL_URL: http://client-1
      RUSTYBIN_HARNESS_DATA_PLANE: "off"
    ports:
      - "${HARNESS_CLIENT_1_PORT:-18902}:80"

  client-2:
    <<: *node
    container_name: harness-client-2
    environment:
      <<: *node-env
      RUSTYBIN_INSTANCE_ID: client-2
      RUSTYBIN_HARNESS_ROLES: client
      RUSTYBIN_HARNESS_TARGETS: gateway
      RUSTYBIN_HARNESS_DATA_PLANE: "off"
    ports:
      - "${HARNESS_CLIENT_2_PORT:-18903}:80"

  # Two server nodes are the gateway's upstreams; they correlate every
  # marked request and tag every answer.
  server-1:
    <<: *node
    container_name: harness-server-1
    environment:
      <<: *node-env
      RUSTYBIN_INSTANCE_ID: server-1
      RUSTYBIN_HARNESS_ROLES: server
      RUSTYBIN_HARNESS_ADVERTISE: http://server-1
    ports:
      - "${HARNESS_SERVER_1_PORT:-18904}:80"

  server-2:
    <<: *node
    container_name: harness-server-2
    environment:
      <<: *node-env
      RUSTYBIN_INSTANCE_ID: server-2
      RUSTYBIN_HARNESS_ROLES: server
      RUSTYBIN_HARNESS_ADVERTISE: http://server-2
    ports:
      - "${HARNESS_SERVER_2_PORT:-18905}:80"

  # The stand-in gateway: a reverse proxy over the two server nodes. Put
  # your own gateway here and point it at GET .../clusters/perf-1/upstreams.
  gateway:
    image: nginx:1.27-alpine
    container_name: harness-gateway
    volumes:
      - ./gateway.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - server-1
      - server-2
    ports:
      - "${HARNESS_GATEWAY_PORT:-18906}:80"

Failover

Nodes with RUSTYBIN_HARNESS_CONTROL_URL are eligible to lead; RUSTYBIN_HARNESS_LEADER=prefer makes a standby that is first in the succession whatever its work, and a coordinator-only node with a control URL and RUSTYBIN_HARNESS_JOIN joins as one. The leader replicates a versioned snapshot (who leads, the term, the succession; to eligible nodes also the members, the runs with a checkpoint of their stats every 5 s, and the secrets). When the leader has not answered for the election timeout (RUSTYBIN_HARNESS_ELECTION_TIMEOUT, 3 s, below the lease), the first node in the succession stands for election and needs the votes of a majority of the eligible nodes, so failover needs three of them; GET .../leader says whether it is available. The new leader takes over from the snapshot within the lease, so the clients never stop; they report their cumulative stats to it again, which fills the gap exactly. Whatever the old leader's own client part may have sent after its last checkpoint is reported as unreported, an upper bound, never dropped silently. A leader that cannot hear a majority stops renewing leases (the minority side of a partition stops sending), and one that finds the leader of a newer term steps down. A crashed leader that restarts is a new node: start it as a standby pointing at any eligible member to rejoin.

To take the leader down for maintenance, ask it to step aside first, with POST /_rustybin/harness/clusters/{id}/leader/step-aside on the leader, rustybin harness step-aside <id>, the step_aside tool, or Step aside on the cluster card. It needs three or more eligible nodes. The leader stops renewing leases and the first in the succession takes over by the ordinary election, within the election timeout, so the run stays on and nothing is lost; the old leader follows the new one. If nobody takes over within four election timeouts it keeps leading.

# One eligible node: nobody can take over, so the leader stays.
POST {{harness_url}}/_rustybin/harness/clusters/docs-cluster/leader/step-aside
Authorization: Bearer {{admin_token}}
HTTP 409
[Asserts]
jsonpath "$.error" contains "failover needs three"

A leader steps down only for a newer leader it can check: an announcement from a node it knows as eligible, at a term at most 16 ahead of its own, naming the control URL that node joined with; or, when a member's heartbeat claims a newer term, an eligible node that answers its probe as that term's leader at its own control URL (or names one that passes the same checks). The claim alone only starts the probe (at most every half election timeout), so a member cannot depose the leader by saying so. A member follows a leader on the same terms, whether an elected announcement names it, a node's 409 does or a probe of the succession finds it; anything else is refused, so a member's node credential cannot crown its holder. Every call between nodes refuses link-local, cloud metadata, unspecified, multicast and broadcast addresses at the connection itself (names are resolved and checked for each connection), so a name that changes its answer after a URL was checked gets nowhere. The join token is a cluster credential: a holder can join as an eligible node (with a control URL) and so receive the snapshot, secrets included, and stand in elections. Treat it like the admin token: give it only to the nodes you run, and rotate it (a new cluster) if it leaks.

The compose cluster has three eligible nodes (the leader, the standby and client-1). conformance/harness/run.sh starts it, kills the leader ten seconds into the run and asserts the report the standby produces: the standby leads the new term, both clients finished with their half of the rate, no second of the timeline is empty, lost and unreported are 0, the thresholds pass. Run it, or kill the leader yourself:

docker compose kill leader
curl -s localhost:18901/_rustybin/harness/clusters/perf-1/leader | jq '.leader, .history'

Safety

Load only goes where the operator said: the allowlist (RUSTYBIN_HARNESS_TARGETS), checked by name and by every resolved address, with link-local, cloud metadata, multicast and the node's own control plane always refused; pinned connections, so a DNS change during a run cannot redirect it; optional target verification through /.well-known/rustybin-harness (proof of the route, not of the owner's consent, see above); caps per node on rate, requests in flight and duration; one run at a time (a start being prepared holds the slot, so parallel starts get 409, and a kill pressed while a run is still resolving or verifying its targets keeps it from starting); a node never sends above its rate cap, whatever the live multipliers and its share say (a re-split share is checked with the multipliers in force, and the scheduler clamps too); answers with absurd Server-Timing or Retry-After values cannot stall a run; a lease that stops a cluster's clients when the leader is gone; a kill switch; the harness control scope; and a fatal refusal to start in public mode or with self-service mocks. In a cluster, each node applies its own caps and allowlist to every assignment it receives, and node-to-node calls (join, heartbeat, vote, announcement) refuse a URL with credentials and every link-local, cloud metadata or multicast address, checked at each connection, so a DNS change cannot turn a node into a way to reach one.

Two things send in other ways and go through the same fences. An HTTP/3 target is pinned like any other and QUIC connects to the pinned addresses only, so UDP is no way around the allowlist. A chain is the only traffic the server role sends: only for a request carrying its run's signed marker, only while the run is live, only to the hops the scenario names (each allowed on the server node, pinned and verified like a target), once per request and hop to a fixed depth, and the kill switch stops it at once.

Testing it

cargo test covers the engine, correlation, patterns, rate-limit tests, mock traffic, identities, faults and protocols against an in-repo test proxy that stands in for a gateway (it adds headers, answers its own 429s, drops requests and has reference rate limiters with known flaws), and the cluster and failover with several nodes in one process. docs/examples/run.sh runs this page's examples against a loop-through node; conformance/harness/run.sh runs the compose cluster and the failover; cargo run --release --example harness_spike -- --sweep is the engine benchmark.

On every surface

The same job from the API, the console, the command line, an agent and the configuration document.

SurfaceWhere
APIGET /_rustybin/harness, /schema, /scenarios, POST /_rustybin/harness/validate | preview | import | runs, GET, PATCH /_rustybin/harness/runs/{run}, /stop, /events, /report, the cluster routes under /_rustybin/harness/clusters
ConsoleThe Harness view (shown when harness mode is on): the builder generated from the schema with its file field for a recording, a collection or a script, runs, live tuning, reports
CLIrustybin harness validate | run | report offline, the same with --remote and status | scenarios | import | runs | show | tune | stop | stop-all | events | clusters ... against an instance (reference)
Management MCPharness_status, list_scenarios, get_scenario, save_scenario, list_patterns, validate_scenario, preview_scenario, import_traffic, import_scenario, create_run, start_run, update_run, list_runs, get_run, stop_run, get_run_report, harness_stop (the kill switch), create_cluster and the cluster tools; the prompt load_test_gateway; the resource rustybin://harness.schema.json (agent page)
rustybin.yamlharness: (the saved scenarios) (the whole instance as code)
EnvironmentRUSTYBIN_HARNESS, _ROLES, _TARGETS, _MAX_RATE, _MAX_INFLIGHT, _MAX_DURATION, _VERIFY_TARGETS, _SCENARIO, _START, _REPORT, _EXIT and the cluster variables (configuration)