Skip to content
stormbreakerbetadocs
v0.1.1next
GitHub

stormbreaker-rest

View .mdOpen in Claude

Load through a service’s front door: a stream’s records become HTTP requests to a service axx’s rest pack declared, sent open-model at a declared arrival rate, and what the client saw is recorded as the client view. Builds on stormbreaker-core (list it in axx-packs.yaml): binding a stream declares the identities it will create before anything is sent.

List it in the project’s axx-packs.yaml, with the packs it builds on:

axx-packs.yaml
packs:
- rest
- github.com/nimbusxr/stormbreaker/packs/core@v0.1.0
- github.com/nimbusxr/stormbreaker/packs/rest@v0.1.0

In axx.yaml, under packs.stormbreaker-rest:

Setting What it is
connections reuse (the default) keeps a pool of connections open, which a load balancer spreads across the service’s replicas as it spreads its users’; fresh opens one for each request, and runs out of the machine’s ports past a few thousand requests a second.
maxConnections How many connections to the service may be open at once (default 512): past it, requests wait for one, and their latency says so.
maxDrift How late requests may leave their due time, for five seconds in a row, before the load stops, failing because the driver is not keeping up (default 1s; off turns it off).
maxInFlight How many requests may be in flight before the load stops, failing because the service is not keeping up (default 50000).
timeout How long a request may take (default 30s).
Given the {word} stream of {word} requests to {word}[[ on {service}]]

Bind a stream (<name>.stream.yaml) to an endpoint: each record’s data is a request’s JSON body. Binding declares every identity the stream will create, at the service and path, before anything is sent. The path can name variables, {name}, filled from the record’s metadata.

Given the parcels stream of POST requests to /parcels
Given the collections stream of POST requests to /parcels/{reference}/collection on parcels
Given the {word} stream path variables are the {word} metadata

Take each request’s path variables from a metadata entry of its record: a map, by name.

Given the {word} stream query parameters are the {word} metadata

Take each request’s query parameters from a metadata entry of its record: a map, by name.

Given the {word} stream headers are the {word} metadata

Take each request’s headers from a metadata entry of its record: a map, by name.

Given the {word} stream path variable {word} is {string}

Give every request of the stream the same path variable, over what its record says. It is text: one that reads as a number or a boolean goes in double quotes inside the step’s own ('"42"').

Given the {word} stream query parameter {word} is {string}

Give every request of the stream the same query parameter, over what its record says. It is text: one that reads as a number or a boolean goes in double quotes inside the step’s own ('"42"').

Given the {word} stream header {word} is {string}

Give every request of the stream the same header, over what its record says. It is text: one that reads as a number or a boolean goes in double quotes inside the step’s own ('"42"').

Given the requests[[ on {service}]] are identified by {word}

Declare the identities in the payloads of the requests written by hand (with the rest pack’s steps) before each is sent: the values at the JSON paths given, comma-separated.

Given the requests are identified by $.reference
Given the requests on parcels are identified by $.reference,$.pieces[*].id
When the {word} stream is sent at {int} requests per second

Send the stream’s requests open-model: request i is due at i/rate seconds, however the ones before it are doing.

When the parcels stream is sent at 25 requests per second
When {int} {word} requests are sent to {word} at {int} requests per second[[ on {service}]]

Send requests without bodies, open-model, at the rate given.

When 100 GET requests are sent to /ping at 50 requests per second
Then the load completes with no failed requests

Check that no request of the last load failed: none went unanswered, and none was answered 400 or over.

Then the load completes with no failed requests
Then the client's {word} latency of the load is at most {float} seconds

Check a latency quantile of the last load as the client saw it (p50, p99, p99.9): the client view, which is labelled apart from what the service’s metrics say.

Then the client's p99 latency of the load is at most 0.5 seconds