Documentation
¶
Overview ¶
Command usage_settle is Load Experiment 8: what the usage event trigger of ADR 0096 adds to the writes that finish task attempts.
The trigger on task_instances (migration 055) inserts one usage_events row in the transaction of every write that moves a task instance into an attempt-ending state. This harness times those writes through the real SchedulerStore, with the switch off and on: a single settle (one task to success) and a cascade (every task of a wide run to upstream_failed in one statement, the shape of an upstream failure). With the switch off the trigger is not even called for writes into other states, and returns at once for these.
Each case resets the tasks to running between samples, which writes nothing: running is not attempt-ending. The repeated settles of one attempt get a new revision each time, so the revision lookup runs on every sample.
Usage (see test/load/README.md):
DATABASE_URL='postgres://leoflow:leoflow@localhost:5432/leoflow_dev?sslmode=disable' \ go run ./test/load/usage_settle --tasks 1000 --samples 20