Cue

Fixture

Keep this organization on the sequence below when you change it. Done when the performance flows, their step implementations, and the launch commands still match this page.

The organization fixture is a fixture for tests. It is not a business flow. The source is organizations/fixture. organizations/fixture/src/index.ts exports flows, and fixtureFlows is that same list.

The flows are pace, load, stall, fault, soften, aside, nest, nest-mid, nest-leaf, brood, and brood-child. Each one sets validityDurationMs to null and entityType to its name. Silence is a whole number of minutes (silenceDurationMin). Configured work is milliseconds. No step sets rateLimit.

Steps

organizations/fixture/src/steps.ts binds the step implementations with bindOrganization. fixtureSteps stores each bound step under flow/step. The kind is fixture- plus the step name.

dwell has aliases mark and pass-1 through pass-10. Its kind is fixture-dwell, concurrency 4, silence 30 minutes, and maxResends 1. It waits the configured work, then returns done. pace reads dwellMs on dwell and markMs on mark. load, soften, aside, nest, nest-leaf, and brood-child read workMs on dwell. A pass-* step reads dwellMs when that field is present, and workMs otherwise. That count is an integer of milliseconds, zero or greater. A missing or invalid count waits 0 milliseconds. A brood payload has no duration field, so pass-1 through pass-10 wait 0 milliseconds.

stall has kind fixture-stall, concurrency 1, silence 1 minute, and maxResends 0. It throws StepHeld and publishes no result. One minute later the first silence records not_finished.

miss has kind fixture-miss, concurrency 4, silence 30 minutes, and maxResends 0. It returns failed at once and does not throw.

sprout has kind fixture-sprout, concurrency 4, silence 30 minutes, and maxResends 1. It returns done with one child. On nest the identifier is mid- plus the parent identifier. On nest-mid the identifier is leaf- plus the parent identifier. The child payload is { workMs: 0 }.

brood has kind fixture-brood, concurrency 4, silence 30 minutes, and maxResends 1. It returns done with one child per childCount, at most 100. The identifier is c plus the index, a hyphen, and the parent identifier. The child payload is { workMs: 0 }.

Flows

pace opens dwell, then mark, then finishes. The payload carries dwellMs and markMs. The flow finishes success.

load opens one dwell and finishes success. The payload carries workMs. It stays on kind fixture-dwell.

stall opens one required stall and finishes not_finished.

fault opens one required miss and finishes failure.

soften opens optional miss, then dwell, then finishes. The flow finishes success and miss stays failed. The payload carries workMs.

aside opens detached stall, then a required dwell, then finishes. The flow finishes success well before the minute of silence. The detached step later records not_finished and the issue stays success. The payload carries workMs.

nest opens sprout, then opens child flow nest-mid from that body. It then opens dwell with step payload { attachments: [{ attachmentId, rank: 0 }] }. attachmentId is 00000000-0000-4000-8000-000000000000. The wait on that dwell is still workMs from the flow payload. The flow finishes success.

nest-mid opens sprout, opens child flow nest-leaf from that body, then finishes success.

nest-leaf opens dwell and finishes success. The child payload is { workMs: 0 }.

brood opens pass-1 through pass-10, opens step brood, opens child flow brood-child from that body, then finishes success. The payload carries childCount, an integer from 1 to 100.

brood-child opens dwell and finishes success. The child payload is { workMs: 0 }.

Runs

The fixture does not export catalogSeed and does not open a client database. pnpm --dir organizations/fixture seed opens nothing and prints seeded fixture 0 runs.

pnpm --dir organizations/fixture reset deletes the fixture rows in entities and entity_links, then deletes that organization's metrics and the jobs those runs left in Redis. It leaves organizations, memberships, secrets, and the signed-in person in place. The log line is reset fixture.

Performance

pnpm --dir organizations/fixture seed does not start these flows.

Relaunch a run with pnpm --dir organizations/fixture perf. The script is organizations/fixture/scripts/perf-fixture.mjs. It starts the workers these flows need, kinds fixture-dwell, fixture-stall, fixture-miss, and fixture-sprout, and stops them when the run ends. It opens pace, load, stall, fault, soften, aside, and nest.

Load test

Relaunch with pnpm --dir organizations/fixture perf:load. The script is organizations/fixture/scripts/perf-load.mjs. It starts one worker, kind fixture-dwell, WORKER_CONCURRENCY 32, and stops that worker when the run ends. Levels 200, 400, and 800 of load with workMs 0. After 200, a pace wave of 200 with dwellMs 0 and markMs 0. Send is ranAt minus openedAt. Apply is endedAt minus ranAt minus computeMs.

Brood

Relaunch with pnpm --dir organizations/fixture perf:brood. The script is organizations/fixture/scripts/perf-brood.mjs. It starts workers for fixture-brood and fixture-dwell, concurrency 4 on each, and stops them when the run ends. It opens brood families. BROOD_FAMILIES defaults to 2000. Each family carries childCount 10.

pnpm --dir organizations/fixture perf:brood:producer runs organizations/fixture/scripts/perf-brood-producer.mjs. It uses the same two kinds. It opens a wave of 100 families every second for 3 minutes, each with childCount 10, then waits until those runs settle.