cardinal

Seed and load

Write fake records through a site's API, and run the load test while you watch.

Seed fake records

The seed page writes records through POST /api/rec/<RecType> as a real user, so hooks, naming, permissions and realtime all run. Use it to watch the system behave under writes.

Sign in to a site as a user.

Pick a RecType the user may create. The list comes from the desk boot.

Enter how many records to make and start. Watch records per second and errors by status code.

BehaviourDetail
Batches20 records per batch, 8 batches at a time
Submittable RecTypesA third of the records are submitted
A 409 conflictRetried once with fresh values
Any other 4xxStops the seed after its batch
StopFinishes the batch in flight
Link fieldsPick from up to 200 existing names of the target RecType
Table fieldsGet one to three child rows
Names, emails, phone numbersGenerated from the field's label
Record namesPrefixed perch- where the RecType's naming lets the client set the name

Runs live in the page only. Perch keeps no history of them.

Run a load test

The load page runs the load test the Cardinal repo already has. Pick a target:

TargetWhat runs
Isolatedscripts/load.sh NODES VUS on the isolated load stack
This workspacescripts/load.k6.js in the k6 image that deploy/docker-compose.load.yml pins, against a site of this workspace

Options pass as environment variables: VUS, LISTENERS, RAMP, HOLD, THINK, CHAOS and ONE_DRAFT. Perch finds the Cardinal checkout from CARDINAL_HOME, else from the workspace's mix.exs.

While it runs, output streams into the CLI pane, and Perch shows scheduler use, pool busy, lock waits and transactions per second beside it.

When it ends, the summary becomes a results card: requests, rate, failed, p95, max, invoices and submits acknowledged and found, socket joins and rejoin times. Each run's folder is under CARDINAL_WORKSPACE/load-results/.

"This workspace" shows as unavailable until Cardinal's load.k6.js takes BASE from its environment.

On this page