Ci readiness - #153
Open
mokshasoft wants to merge 4 commits into
Open
Conversation
Features: - Add -o/--output option for JSON output (file or stdout with "-") - Add -p/--percentiles option for custom latency percentiles - JSON includes: requests, errors, bytes, duration, rps, latency stats Build improvements: - Add USE_SYSTEM_LUAJIT option to use system LuaJIT instead of bundled - Support pkg-config for LuaJIT and OpenSSL, with manual path fallback - Add flake.nix for nix build support (works on macOS ARM64) - Fix ARM64 compatibility (conditional x86intrin.h include) - Fix newer LuaJIT API compatibility (luaL_reg -> luaL_Reg) Example usage: wrk2 -t4 -c100 -d30s -R1000 -p 50,95,99 -o result.json http://localhost/
The only function used from this header was __builtin_clzll, which is a compiler builtin available on all architectures (ARM, x86, etc.), not an x86 intrinsic. The include was added when hdr_histogram.c was first vendored in 2014 but was never actually needed.
When using -o - to output JSON to stdout, redirect the "Running test" and "Thread calibration" messages to stderr so that stdout contains only valid JSON. This allows piping directly to jq and other tools.
- Add url field to identify tested endpoint - Add config section with threads, connections, duration, rate - Add bytes_per_second for transfer rate - Use full precision (%g) for float values instead of truncated %.2f - Return error code 1 when output file cannot be opened
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add JSON output and configurable percentiles for CI integration
This PR adds two features to make wrk2 easier to use in CI/CD pipelines and automated testing:
JSON Output (
-o)The JSON includes:
-Uflag is used)Configurable Percentiles (
-p)Default percentiles remain: 50, 75, 90, 99, 99.9, 99.99, 99.999, 100
Other improvements
x86intrin.hinclude that broke builds on Apple Silicon and other ARM platformsflake.nixfor reproducible buildsUSE_SYSTEM_LUAJIT=1option with pkg-config supportAll changes are backward compatible - existing scripts and usage patterns work unchanged.