-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Summary: Display thresholds values even when not in summaryTrendStats #4698
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
base: master
Are you sure you want to change the base?
Conversation
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 on my end 🚀
(I believe removing the logs 👇🏻 would fix the tests 🙇🏻 )
internal/js/summary.js
Outdated
console.log(info); | ||
console.log(metric.values); | ||
|
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.
console.log(info); | |
console.log(metric.values); |
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.
Yeah, sorry, I forgot one extra force-push before opening the PR haha 😅
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.
Hehe no worries 😄 Been there, did that, many times 🫶
616bd35
to
17d877e
Compare
@@ -839,7 +839,7 @@ function renderThresholdResults( | |||
: formatter.decorate(failMark, 'red'); | |||
|
|||
const sourceText = formatter.decorate( | |||
`'${threshold.source}'`, |
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.
This isn't directly related, but it's so small that I prefer to add it as part of this PR. It's not a huge deal, but I think it's nice if we trim the threshold's source before displaying it in the summary.
|
||
var percentileThresholdSourceRe = regexp.MustCompile(`^p\((\d+(?:\.\d+)?)\)\s*([<>=])`) | ||
|
||
func extractPercentileThresholdSource(source string) (agg string, percentile float64, isPercentile bool) { |
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.
I know this isn't ideal, but I cannot see any alternative to this that doesn't imply exposing more things from the metrics
package and type (like the parsed
expression and related code), and I think that isn't ideal as well because we do plan to do some refactors there soon-ish.
So, that's why I suggest to go with this, which should be fine as I don't expect the thresholds format to change anytime soon, especially now with v1.0 and the versioning strategy and guarantees.
What?
Makes it possible to display threshold values (since #4089) even when the aggregation on the thresholds expression (e.g.
p(99.5)
) isn't included as part ofoptions.summaryTrendStats
.Why?
Now those values aren't displayed (instead, it prints
undefined
, which I would consider a bug), because we're not calculating values for aggregations other thanoptions.summaryTrendStats
.Alternatively, we could just omit these lines from the summary, but I think these are valuable information for the user, and it's aligned with the goal of the revamped summary.
Checklist
make check
) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)
Closes #4695