Support thresholds and the end-of-test summary in distributed execution #3213
+600
−37
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.
What?
This PR is another sliver of the newly refactored #2816. It builds on top of #3205 to add very basic support for metrics (thresholds and the end-of-test summary, incl.
handleSummary()
) for distributed execution.As you can see from all of the
TODO
s and the lack of tests, this is even more of a proof-of-concept PR than even #3205 😅 It is very far from ready for any kind of actual production usage!Even if we ignore the super-inefficient
string
-y and JSON encoding of metrics data and their transmission over the wire, k6 still doesn't have HDR histograms (#763). So the centralk6 coordinator
node will suffer from the same memory and data processing problems k6 currently does, it will require tons of memory and CPU for crunching the metrics data of large or long-running tests...Why?
Same as the other PRs in this series, I decided to create this PR even when the feature isn't production-ready because I think merging it this way will make it easier to build the final end result in smaller and faster iterations.
Once again, this PR is completely backwards compatible! 🎉 It doesn't have any tests, but it also doesn't disable or change any existing tests or k6 behavior. It only affects distributed execution which, if #3205 is merged, would be kind of hidden and officially quite experimental. But it mostly works and it doesn't need HDR histograms to be figured out before it can be merged! 🎉
So it makes sense to me to have this basic framework merged first and then work on HDR histograms (and the other features that would make distributed execution production-ready) in separate PRs.
Checklist
make ci-like-lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)