Issue: Build Performance & Load Testing Suite
Depends on: A deployable backend build (pnpm run build) and a staging/local instance to target
Task Description
Evaluate the backend's performance under realistic workloads to identify bottlenecks before production, focusing on the Agreement API under increasing load and concurrency.
Deliverable
A performance & load testing suite with documented benchmarks and a summary report, kept separate from the Jest unit/integration suites (load tools must not run in the standard CI test job).
Requirements
Measure:
- API response times (create/read/update agreement,
GET /agreements/:id/activity).
- Database performance (Supabase query latency under load).
- Concurrent Agreement creation and concurrent Agreement updates.
- Activity logging throughput.
- Memory consumption and CPU utilization.
Generate a performance report summarizing results.
Validation System
- Load runs complete against staging and produce metrics for each measured area.
- A performance report is generated with average response time, peak latency, failure rate, and resource utilization.
- Results establish a documented baseline for future comparison.
Technical Requirements
Simulate workloads including:
- 100 concurrent users.
- 500 Agreements and 1,000 Agreements datasets.
- Burst traffic scenarios.
Tooling & constraints:
- Use a Node-friendly load tool (k6, autocannon, or artillery) under a dedicated
test/load/ (or perf/) directory with npm scripts (e.g. test:load).
- Target a staging instance with a seeded test user/JWT and testnet wallet — never production.
- Mock or isolate outbound Trustless Work calls so load reflects Thalos, not TW rate limits.
- Keep these runs out of the default
jest CI job (long-running, environment-dependent); trigger manually or in a separate workflow.
Additional Notes
Objective is a performance baseline for future optimization and production-readiness, not a pass/fail gate on every PR.
Testing (required)
Proof of Completion (required)
Issue: Build Performance & Load Testing Suite
Depends on: A deployable backend build (
pnpm run build) and a staging/local instance to targetTask Description
Evaluate the backend's performance under realistic workloads to identify bottlenecks before production, focusing on the Agreement API under increasing load and concurrency.
Deliverable
A performance & load testing suite with documented benchmarks and a summary report, kept separate from the Jest unit/integration suites (load tools must not run in the standard CI test job).
Requirements
Measure:
GET /agreements/:id/activity).Generate a performance report summarizing results.
Validation System
Technical Requirements
Simulate workloads including:
Tooling & constraints:
test/load/(orperf/) directory with npm scripts (e.g.test:load).jestCI job (long-running, environment-dependent); trigger manually or in a separate workflow.Additional Notes
Objective is a performance baseline for future optimization and production-readiness, not a pass/fail gate on every PR.
Testing (required)
test/load/(orperf/) with atest:loadscript and are excluded from the default CI test job.Proof of Completion (required)