Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 2.51 KB

File metadata and controls

61 lines (47 loc) · 2.51 KB

Contributing to loadtest

Thanks for your interest in improving loadtest! This project values correctness, honest measurement, and a clean, layered architecture.

Getting started

git clone https://github.com/alphaBitCore/loadtest
cd loadtest
make test     # build + vet + race tests
make cover    # enforce the per-package coverage gate (≥95% on library packages)

Architecture (please respect the layers)

The packages form an acyclic dependency graph; keep it that way:

protocol, metrics   (leaves, no internal deps)
config              → protocol, metrics
engine              → config, protocol, metrics
report              → config, metrics
cmd/loadtest        → config, engine, report  (thin wiring only)
  • Adding a provider/wire format? Write one file in protocol/ that implements Protocol and self-registers in init(). Do not touch the engine, metrics, or report — that is the whole point of the abstraction.
  • Hot-path code (anything called per request/turn) must stay allocation-light and lock-free. The metrics aggregator is lock-free by design; do not reintroduce a mutex on the per-request path. Add a benchmark if you change it.
  • Keep cmd/loadtest/main.go thin. Testable logic belongs in a library package.

Before you open a PR

  1. make fmtgofmt must be clean (CI rejects unformatted code).
  2. make testgo vet clean, all tests pass under -race.
  3. make cover — every library package stays at ≥95% line coverage. New code needs tests; prefer extracting pure functions to make edge cases testable rather than leaving them uncovered.
  4. Update DESIGN.md / README.md if you change behaviour or the config schema.
  5. Do not commit secrets, real gateway domains, or API keys. Profiles must use localhost targets and the REPLACE_WITH_VK placeholder.

Commit & PR style

  • Small, focused commits with a clear subject (e.g. feat(protocol): add gemini adapter).
  • Explain why in the PR description, not just what.
  • The CI workflow (build, vet, gofmt, race tests, coverage gate) must be green.

Reporting bugs / requesting features

Open an issue using the templates in .github/ISSUE_TEMPLATE/. For anything that looks like a measurement-correctness problem (coordinated omission, percentile accuracy, generator-side saturation misattributed to the server), include the profile and the report-*.txt generator-health section.

By contributing you agree that your contributions are licensed under the Apache License 2.0 (see LICENSE).