SpitfireLoad Testing & APMWhat's new

Test editor

In the test editor you define what a test does: scenarios, steps, values extracted from responses, checks and thresholds. The load is set on Load model. Everything in the form has a JSON equivalent; the CLI runs the same JSON.

The test editor: tabs, scenario buttons, load model and the first stepThe test editor: tabs, scenario buttons, load model and the first step

How to create a test from a template

  1. Click Tests → From a template.
  2. Pick a template (HTTP API, sale-day rehearsal, e-commerce, GraphQL, WebSocket, gRPC, Kafka, RabbitMQ, MQTT, OCPP, Redis, MongoDB, SQL).
  3. Fill in the fields with a red asterisk (address, connection).
  4. Check the Thresholds and load suggestion; if you change it, Back to suggestion undoes it.
  5. Click Create test (to open it unsaved, Open in the editor).

How to create your first test

  1. On Load Testing → Tests (Tests In Spitfire: /tests) click New test.

    New test: the skeleton the editor opens withNew test: the skeleton the editor opens with

  2. Type a name in Test name.

  3. On the General & variables tab set base to your system's address (no trailing /).

  4. On the Scenarios & steps tab pick 5 VUs, 1 minute under Load (Which load model).

  5. In the first step enter Step name, Method and URL ({{base}}/api/login).

  6. For the next requests click Add step.

  7. Look at the pass/fail criteria on the Thresholds and guard (N) tab (Defining thresholds).

  8. Click Try it, then Save. Run on the test's page starts the run.

How to add a scenario

  1. On the Scenarios & steps tab click Scenario with the plus icon.
  2. Type a Scenario name (letters, digits, _, -).
  3. Pick the scenario's load model under Load.
  4. Optionally set a Start delay.

Scenarios run at the same time. There are no ifs, loops or step groups: use a separate scenario for another flow and Run once per VU for one-time work.

How to add a step

  1. Click Add step.
  2. Pick the Protocol.
  3. Outside the HTTP family pick the Connection; if there is none, Create a connection.
  4. Fill in the protocol's form (HTTP: Method, URL, Headers, Query, Body).
  5. If it changes data, tick This request changes data on the target.

HTTP step: method, URL, Headers / Query / Body and checksHTTP step: method, URL, Headers / Query / Body and checks

Field Description
Method GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS.
URL A full address or a template: {{base}}/api/items/{{id}}. A URL without variables must start with http:// or https://.
This request changes data on the target Asks for a write confirmation before every run and Try it. Non-GET steps imported from API docs come ticked.
Headers Key/value rows; the value can be a template.
Query Parameters added to the URL.
Body None, JSON, XML, Form (urlencoded), Form (multipart / files), Raw.

How to use variables

Write {{name}} in fields such as URL, header and body; the value is filled in on every request. You can use test variables, data file columns ({{users.email}}, Test data) and variables extracted in earlier steps.

Defining test variables

  1. On the General & variables tab click Add variable.
  2. Enter a name (base, api_key; not starting with a digit) and a value.

The value is plain text and shows in the version history; do not put real secrets in it.

Built-in values

Syntax Value
{{__VU}} The VU number (starts at 1, unique across all runners)
{{__ITER}} That VU's iteration counter (starts at 0)
{{$uuid}} A random UUID (v4)
{{$timestamp}}, {{$unix}}, {{$isoTimestamp}} Now: Unix milliseconds, Unix seconds, RFC 3339 (UTC)
{{$randInt 1 100}} A random integer from 1 to 100 (both included)
{{$randString 12}} 12 random letters/digits (0-4096)
{{$hmac sha256 key msg}} HMAC of variable msg with key (md5, sha1, sha256, sha512; hex, or base64 with base64 at the end)
{{$hash sha256 v}} Digest of variable v (hex or base64)
{{$base64 v}} Variable v, base64
{{fake.tckn}}, {{fake.iban}}, … Synthetic Turkish test data; listed on the Test data page

Built-in values and fake data buttons on the step cardBuilt-in values and fake data buttons on the step card

How to extract a value from a response

  1. On the step that produces the value open the Extract tab and click Add variable.
  2. Enter Variable name (token), Source and Expression ($.token).
  3. Use it in a later step: Bearer {{token}}.
  4. With Try it see the "Extracted: token=…" line.

Extract tab: variable name, source, expression and defaultExtract tab: variable name, source, expression and default

Source Expression example What it takes
JSONPath $.data.token, $.items[0].id The first match (objects/arrays as JSON)
Key of the first record id, uid This field of the first record in the top-level list
XPath (XML) //token, count(//item) The first node's text, or the expression's value
Regex id=(\d+) The first match (group 1 if there is a group)
Between boundaries left name="csrf" value=", right " The text between the two boundaries
CSS selector (HTML) input[name=_token], attribute value The first element's attribute, or its text if empty
Header / metadata X-Request-Id An HTTP header, gRPC metadata or a message header
Cookie (Set-Cookie) sessionid The cookie with that name (the last one if repeated)
Status (empty) 200 for HTTP, OK for gRPC

How to add a check

  1. On the step's Checks tab click Add check.
  2. Pick the Check type.
  3. If needed enter a Path, then Operator and Value ("one of": 200, 201).

Checks tab: check type, path, operator and valueChecks tab: check type, path, operator and value

Warning

A failed check does not fail the run on its own. To make it fail, add a threshold on the checks metric (rate>0.99).

Check type Path Operators Example
Status - =, ≠, <, one of = 200
Latency (ms) - <, ≤ < 800
Body contains - contains, doesn't contain contains "orderId"
JSON field $.status =, ≠, >, ≥, <, ≤, contains, exists, one of $.status = "PAID"
XML field (XPath) /order/total =, ≠, >, ≥, <, ≤, contains, exists /order/total > 0
Header / metadata Content-Type =, contains, exists Content-Type contains json
Row count (SQL/Mongo) - =, ≠, >, ≥, <, ≤ ≥ 1

How to add think time

  1. Open the step's More tab.
  2. Enter min and max under Think time (pause after the step).
  3. For a one-time step such as login tick Run once per VU.

More tab: once per VU, think time and step idMore tab: once per VU, think time and step id

How to add an environment

  1. Define the variable that changes on General & variables (e.g. base).
  2. On the Environments tab click Add environment and type an Environment name.
  3. Under Variables enter this environment's values.
  4. Under Connections map the connections (orders-db → orders-db-staging).
  5. Save; the environment shows in the Run dialog under Environment and scale → Environment.

Environments tab: environment name, variable values and connection mappingEnvironments tab: environment name, variable values and connection mapping

json
"variables": { "base": "https://shop.example.com" },
"environments": {
  "staging": {
    "variables": { "base": "https://shop.staging.example.com" },
    "connections": { "orders-db": "orders-db-staging" }
  }
}

How to try a single iteration

  1. Click Try it (if the test changes data, I understand, try it).
  2. In the Try (1 VU, 1 iteration) window look at each step's Request, Response, checks and Extracted values.

Try window: each step's request, response, check and extract resultsTry window: each step's request, response, check and extract results

How to save or go back to an older version

  1. Click Save; a new version (v1, v2, …) is added.
  2. For an older one open Version history (current: vN) on the test page.
  3. See the difference with Diff with current and click Restore this version.

Version history on the test pageVersion history on the test page

JSON view

  1. Open the JSON tab.
  2. Edit or paste, then click Apply.
  3. Click Save.

JSON tab: the full definition, Apply and CopyJSON tab: the full definition, Apply and Copy

Full example

Each VU logs in once, lists products and orders the first one. Replace base with your address.

json
{
  "version": 1,
  "name": "Checkout flow",
  "variables": { "base": "https://shop.example.com", "password": "Test1234!" },
  "options": { "timeout": "30s" },
  "scenarios": [{
    "name": "checkout",
    "executor": { "type": "ramping-vus", "startVUs": 0, "stages": [
      { "duration": "1m", "target": 20 }, { "duration": "3m", "target": 20 }, { "duration": "30s", "target": 0 } ] },
    "steps": [
      { "id": "login", "name": "Login", "once": true, "protocol": "http",
        "request": { "method": "POST", "url": "{{base}}/api/login",
          "body": { "type": "json", "content": "{\"email\": \"vu{{__VU}}@example.com\", \"password\": \"{{password}}\"}" } },
        "extract": [ { "var": "token", "from": "jsonpath", "expr": "$.token" } ],
        "checks": [ { "type": "status", "op": "eq", "value": 200 },
                    { "type": "jsonPath", "path": "$.token", "op": "exists" } ] },
      { "id": "list_products", "name": "List products", "protocol": "http",
        "request": { "method": "GET", "url": "{{base}}/api/products",
          "headers": [ { "key": "Authorization", "value": "Bearer {{token}}" } ],
          "query": [ { "key": "page", "value": "{{$randInt 1 5}}" } ] },
        "extract": [ { "var": "productId", "from": "jsonpath", "expr": "$.items[0].id", "default": "1" } ],
        "checks": [ { "type": "status", "op": "eq", "value": 200 },
                    { "type": "latency", "op": "lt", "value": 800 } ],
        "thinkTime": { "min": "1s", "max": "3s" } },
      { "id": "create_order", "name": "Create order", "protocol": "http",
        "request": { "method": "POST", "url": "{{base}}/api/orders",
          "headers": [ { "key": "Authorization", "value": "Bearer {{token}}" },
                       { "key": "Idempotency-Key", "value": "{{$uuid}}" } ],
          "body": { "type": "json", "content": "{\"productId\": \"{{productId}}\", \"quantity\": 1}" },
          "modifiesData": true },
        "checks": [ { "type": "status", "op": "in", "value": [200, 201] },
                    { "type": "jsonPath", "path": "$.status", "op": "eq", "value": "CREATED" } ] }
    ]
  }],
  "thresholds": [
    { "metric": "req_duration", "expr": "p(95)<500" },
    { "metric": "req_failed", "expr": "rate<0.01" },
    { "metric": "req_duration", "filter": { "step": "create_order" }, "expr": "p(95)<800" },
    { "metric": "checks", "expr": "rate>0.99" }
  ]
}

Options

Setting Default Note
Request timeout 30s A request that takes longer is a "timeout" error.
Graceful stop 30s The time running iterations get when the run stops.
HTTP version Automatic (HTTP/2 when available) HTTP/1.1 only, HTTP/2, HTTP/3 (QUIC, UDP).
Max redirects 10 0 follows no redirects.
When a runner is lost Stop the run or Continue with the rest (less load).
Cookies Each VU keeps its session (recommended) Off: only the step's Cookie header is sent.
Failed request samples On Turn off when responses carry sensitive data.
traceparent header On Joins the run with the system's traces.
Skip TLS certificate verification off Only in test environments with self-signed certificates.
Don't keep response bodies off Saves memory at very high load; extractors still work.
Never reuse connections off Every request opens a new TCP/TLS connection; source ports can run out.
Close connections between iterations off Every iteration connects like a new user.

Options tabOptions tab

Details

Topic Note
Save and Try it Save does not start a run; with errors ("N errors:", a mark on the tab) Try it and Save are disabled. Paths count from 0: scenarios[0].steps[1] = the first scenario's second step
Templates Stay within the free license; with --with-demo HTTP and OCPP point at the demo target. The Kafka topic and RabbitMQ queue must exist; the gRPC schema comes from reflection or .proto (gRPC)
Template fields List → detail: only the field name as key (id). Anyone opening the login template sees its password. SQL templates only read, PostgreSQL syntax (Schema suggestions)
Sale-day rehearsal From your normal visit rate (a visit = 2 requests; if unknown, busiest hour's requests ÷ 7200)
E-commerce Sends the order twice with the same Idempotency-Key; a different id fails it via DUPLICATE ORDER. Spike peak (VUs), Duration · traffic-mix are paid; fault injection, APM alerts; for the synthetic flow see synthetic monitoring
OCPP The station id is appended to the address (<address>/<prefix><n>, n = 1-50)
My templates Save as template (workspace admin); variables become form fields; at most 200
Shared headers Shared headers (all scenarios) go with every HTTP, GraphQL, WebSocket, SSE step; a step's own header with the same name wins
Protocols HTTP, GraphQL, Browser, WebSocket, SSE, gRPC, MQTT, NATS, AWS SQS / SNS, RabbitMQ, Kafka, Redis, SQL, MongoDB, Script (Script step)
Changing protocol Protocol fields and checks reset; extractors, think time and name stay
Step id Made from the name, used by threshold filters (filter.step); changed only on JSON
HTTP errors Connection errors, timeouts, status ≥400; a code a status check expects does not count
Body Without Content-Type one is added for the body type; multipart File name (for files), binary Value is base64 (binary file). Quote variables inside strings
Template errors An unclosed {{, an unknown $ function; a variable without value is empty text. In SQL use $1, ?, @p1, :1 parameters
Extract When not found, the previous iteration's value is not used: default, then the test variable of the same name, then empty
Check value Read as JSON: 200 number, "200" text; an empty name is generated (status == 200)
Think time Lowers the request rate in closed models; needs more VUs in open models
Once per VU Retried on the next iteration if it fails; cookies are kept per VU
Tests that change data The red warning is not an error; runs and Try it ask for confirmation
Two editors "Someone else saved this test since you opened it.": JSON → Copy, reload, apply again
Restoring Saved as a new version; a definition using a deleted connection is refused
Durations "500ms", "30s", "1m30s"; a bare number written by hand is milliseconds

Common problems

Symptom Cause Fix
scenarios[0].name: must be letters, digits or _ and not start with a digit A hyphen, space or non-ASCII letter, or a leading digit. checkout_flow instead of checkout-flow. The same rule applies to variable and extractor names.
...request.url: must be an absolute http(s) URL The URL has no variable and does not start with http(s)://. Write the full address or use {{base}}/path.
Try it to http://localhost:… gives connection refused In the container, localhost is the container itself. On Docker something like http://host.docker.internal:5001, on Kubernetes the service name (http://orders.shop:8080).
unknown variable {token} The variable is not defined or is extracted in a later step. Define the variable or move the extractor to an earlier step. Names are case-sensitive.
invalid JSON: … (body) A variable inside a string has no quotes. Write "id": "{{productId}}".
duplicate login Two steps have the same id, or two scenarios the same name. Change one of the step ids on the JSON tab.
"Not found: token" in Try it The expression does not match the real response, or the step failed. Look at the Response body in the window and fix the expression.
Checks fail but the run "Passed" Checks don't fail the run on their own. Add a rate>0.99 threshold on the checks metric.