Skip to content

Add merge script to vegeta module#63

Merged
meecethereese merged 12 commits into
mainfrom
maufe/vegeta-merge
Apr 1, 2026
Merged

Add merge script to vegeta module#63
meecethereese merged 12 commits into
mainfrom
maufe/vegeta-merge

Conversation

@meecethereese
Copy link
Copy Markdown
Contributor

@meecethereese meecethereese commented Mar 31, 2026

This PR adds the functionality of merging results following a distributed load test setup.

  • Updated vegeta run pipeline (modules/vegeta/run/run.sh)
    • Replaced temp-file-then-replay approach with a streaming tee pipeline
    • Now tee simultaneously saves raw binary to a .bin file and streams through vegeta encode
  • Added multi-pod merge script (modules/vegeta/merge/merge.sh)
    - New script that takes one or more raw vegeta .bin files and produces jaggr-format per-second JSON output
    - Uses gawk with actual request timestamps for bucketing (not wall-clock time)
    - Works correctly on saved/replayed data and correctly interleaves results from pods that started at slightly different times
  • Wired merge into Dockerfile entrypoint and added gawk to the base image
  • Expanded vegeta module tests (modules/vegeta/test/test.sh)
    - Added tests for .bin file production, per-second bucketing correctness, single-file merge, simultaneous multi-file merge, and synthetic latency percentile verification with exact expected
    values
  • Added CI multi-pod merge job (.github/workflows/validate.yaml)
    - New test-merge job that runs 4 simultaneous vegeta attacks at 50 RPS for 15s, merges the results, and validates line count, combined RPS, code histogram integrity, and JSON structure
    - Added gawk to CI module-test dependencies
    - Server readiness loop fails explicitly with container logs on timeout

@meecethereese meecethereese requested a review from a team as a code owner March 31, 2026 22:15
Comment thread modules/vegeta/merge/merge.sh Outdated
# Note: The first and last second-buckets may be partial (vegeta doesn't start/stop exactly
# on second boundaries). Consumers should account for this when validating RPS values.

set -e
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding set -o pipefail here (i.e. set -eo pipefail).

The merge pipeline is vegeta encode | sort | gawk. Without pipefail, if vegeta encode fails on a corrupted .bin file, sort and gawk will process empty/partial data and exit 0, producing incorrect (or empty) output silently. The subsequent empty-file check would only catch the fully-empty case, not partial/corrupt output.

Same applies to run.sh (pre-existing).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really good catch, I'll update for this

Comment thread .github/workflows/validate.yaml
Comment thread modules/vegeta/merge/merge.sh
@meecethereese meecethereese merged commit 7064a0d into main Apr 1, 2026
15 checks passed
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.

2 participants