Skip to content

Add local performance benchmark harness - #168

Merged
llbbl merged 1 commit into
masterfrom
feature/issue-119-performance
Sep 13, 2026
Merged

llbbl merged 1 commit into
masterfrom
feature/issue-119-performance

Conversation

@llbbl

@llbbl llbbl commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Closes #119

Summary

  • Add deterministic, guarded benchmark data seeding for local performance runs.
  • Add local-only k6 scenarios for HTTP message posting, message reads, and WebSocket fanout.
  • Document reproducible baseline results and how to compare future runs.

Changes

Benchmark Harness

  • app/Commands/SeedMessages.php: Add seed:messages with production and BENCHMARK_MODE safeguards, reserved users, and deterministic message data.
  • app/Config/RateLimit.php: Relax rate limits only for non-production benchmark mode.
  • bench/lib/auth.js: Share authenticated k6 session setup and endpoint configuration.
  • bench/post-messages.js: Exercise 10-VU message posting for 30 seconds.
  • bench/read-messages.js: Exercise 50-VU message reads for 30 seconds.
  • bench/websocket-fanout.js: Measure 100-client WebSocket broadcast delivery.
  • package.json: Add bench:post, bench:read, and bench:ws scripts.

Documentation and Tests

  • bench/README.md: Document prerequisites, setup, commands, thresholds, and interpretation.
  • docs/performance.md: Record baseline results against commit 12b314c with machine and runtime details.
  • tests/Tests/Integration/SeedMessagesCommandTest.php: Verify guarded seeding, input validation, replacement behavior, and deterministic output.

Validation

  • composer validate
  • 166 unit tests / 497 assertions
  • 10 integration tests / 56 assertions
  • 1 WebSocket integration test / 8 assertions
  • PHPStan
  • CS check
  • pnpm build
  • 5 Playwright tests
  • composer audit
  • pnpm audit --prod
  • k6 inspect for all three scenarios
  • Actual post, read, and WebSocket benchmarks

Mutation testing remains manual-only through the workflow_dispatch workflow and was not added to automatic pull-request CI.

@llbbl
llbbl merged commit da37bac into master Sep 13, 2026
6 checks passed
@llbbl
llbbl deleted the feature/issue-119-performance branch September 13, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add lightweight performance / load testing harness

1 participant