5 Commits

Author SHA256 Message Date
Alphaeus Mote 23ddf5c665 test(loadbench): the connect storm's settings answers and ready events, and an upgrade fan-out [skip ci]
- Connect storm: settings answers counted by first try and retries, with
  their reply times (p50, p95, max); the phase also waits for every
  device's ready event to be stored. --settings-retry retries a missed
  pull as the agent does (default: one try, what reaches a device at once).
- --upgrade: an MSI made up for the catalog, every device queued for it,
  the scheduler running as with SCHEDULE_WORKER on and StartWithinMinutes
  from --start-within (default 1); the simulated agents count upgrade
  commands and a second one for the same version, and each pass's sends are
  timed from the pass's start to the last publish returned.
- --burst false skips the job burst.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:02:40 -05:00
Alphaeus Mote dead6683e2 perf(bench): load benchmark switches to PostgreSQL and times the burst to the second [skip ci]
--provider postgres runs on a throwaway database (PG* variables), dropped afterwards. The job burst is sampled every second and reports when every job's final state was stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 04:30:37 -05:00
Alphaeus Mote 6920217403 perf: load benchmark keeps the shared server's streams in memory storage
Switching the streams to file storage for a run had a concurrent test
run delete them under the benchmark (its agents then got no commands).
The benchmark now keeps memory-storage streams, as the integration tests
do, and makes the backend's job event consumer itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 23:09:38 -05:00
Alphaeus Mote 94bccc1235 Merge main; sealed tests keep the shared NATS in memory storage
Merges local main (its job pipeline test starts the command stream over
in memory storage when the server holds an incompatible one; taken as
it is). The sealed tests' fixture now makes the command and job event
streams itself in memory storage, as the pipeline test does, with the
backend's job event consumer, starting a stream over when another run
left it with settings that cannot be updated, and again before each test
agent (another run may have reset them). The backend's own file-storage
provisioning then only logs that it cannot change them. Each test agent
deletes its consumer when it stops.

The load benchmark switches the streams to file storage for a run (as in
production) and its cleanup, run after each run, puts memory-storage
streams back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:53:07 -05:00
Alphaeus Mote b04bf93a70 perf: load benchmark for server sizing (tests/LoadBench)
A console program, not a test project and not run by CI. "run" hosts the
real backend (its messaging workers, job runner, message security and
enrollment, SQLite) against the NATS server at NATS_URL, enrolls N
devices through the real bootstrap endpoint (sealed or v1), and starts a
child process of simulated agents: each with the agent's own message
security and publisher, multiplexed over a few NATS connections, each
pulling its own durable command consumer. It measures a connect storm
(ready, settings pull, inventory, presence from every device within
20 s), steady state (presence every 30 s, inventory every 15 min) and a
job burst (a script to every device through the job runner, ~20 output
lines and two states each): CPU and memory of the server, the agents and
nats-server, messages per second, drops, and how long each takes.
"micro" times sealing and opening per message, and the job runner's
fan-out per device; "cleanup" removes consumers a stopped run left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:33:52 -05:00