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.
| Behaviour | Detail |
|---|---|
| Batches | 20 records per batch, 8 batches at a time |
| Submittable RecTypes | A third of the records are submitted |
| A 409 conflict | Retried once with fresh values |
| Any other 4xx | Stops the seed after its batch |
| Stop | Finishes the batch in flight |
| Link fields | Pick from up to 200 existing names of the target RecType |
| Table fields | Get one to three child rows |
| Names, emails, phone numbers | Generated from the field's label |
| Record names | Prefixed 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:
| Target | What runs |
|---|---|
| Isolated | scripts/load.sh NODES VUS on the isolated load stack |
| This workspace | scripts/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.