-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate thresholds at init #2463
Conversation
8ea9ce4
to
766afc4
Compare
8950690
to
1605cfa
Compare
a2010e7
to
b5192d0
Compare
The PR descriptions still talks about submetric checking
|
@mstoykov Good catch 👍🏻 Edited out 🙇🏻 |
b5192d0
to
052e2d4
Compare
For your information: I've updated the code of the |
As a general nitpick: I think you are adding why too many And in that later case, each assert/require not being on 4 lines will be more beneficial IMO. |
46e8a7b
to
43e29c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great comments, and for making errors with high dev experience for k6 users. 🙏
I left some comments, some of them could be applied in multiple places but I didn't spot all of them because I expect some could require some discussions before.
bc07116
to
0dc981a
Compare
@mstoykov I've removed most @olegbespalov @codebien I've addressed your comments 👍🏻 Let me know if you have other comments and suggestions. Otherwise, I'll be looking forward to the approval 🚅 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏 Just one minor thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉 👏
924fcf7
0dc981a
to
924fcf7
Compare
The newly introduced ParseMetricName function takes a metric name expression of the form `name{tag_key:value,...}` and splits into its name, and tags. This function proves useful when needing to address metrics, and their submetrics.
The newly introduced Validate method ensures that for a given collection of Thresholds, they apply to existing metrics/submetrics, and apply methods that are supported by the former.
This commit ensures that impacted commands (run, archive, cloud) validate thresholds before running.
924fcf7
to
130e61d
Compare
What this PR does
We merged Go-based thresholds parsing in
v0.37.0
. This Pull Request builds upon that and implements thresholds validation at init. As of this PR, unless the--no-thresholds
flag is passed, thresholds will be checked before the execution of k6 commands. Specifically, if a threshold applies to a non-existing metric, or if it uses an aggregation method that's not supported by the former, k6 will immediately produce an error; the execution won't even start.This addresses #2330 to the extent of the internally agreed upon scope.