-
Notifications
You must be signed in to change notification settings - Fork 569
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
MQE: improve runtime of mixed metrics tests #10678
Conversation
…ime over multiple series at a time
…rs, and only run with two series rather than up to four
// Generate combinations of 2, 3, and 4 labels. (e.g., "a,b", "e,f", "c,d,e", "a,b,c,d", "c,d,e,f" etc) | ||
// Generate combinations of 2 labels. (e.g., "a,b", "e,f" etc) | ||
labelCombinations = append(labelCombinations, testutils.Combinations(labelsToUse, 2)...) | ||
labelCombinations = append(labelCombinations, testutils.Combinations(labelsToUse, 3)...) | ||
labelCombinations = append(labelCombinations, testutils.Combinations(labelsToUse, 4)...) | ||
|
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.
Rationale: these functions all operate a series at a time, and any issue working with multiple series is likely to be surfaced running with two series.
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.
that's fair for non aggregations
@@ -2981,8 +2977,6 @@ func TestCompareVariousMixedMetricsVectorSelectors(t *testing.T) { | |||
for _, function := range []string{"rate", "increase", "changes", "resets", "deriv", "irate", "idelta", "delta", "deriv", "stddev_over_time", "stdvar_over_time"} { | |||
expressions = append(expressions, fmt.Sprintf(`%s(series{label=~"(%s)"}[45s])`, function, labelRegex)) | |||
expressions = append(expressions, fmt.Sprintf(`%s(series{label=~"(%s)"}[1m])`, function, labelRegex)) | |||
expressions = append(expressions, fmt.Sprintf(`sum(%s(series{label=~"(%s)"}[2m15s]))`, function, labelRegex)) |
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.
Rationale: we already extensively test sum
in TestCompareVariousMixedMetricsAggregations
.
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 would like to keep these. They test reusing pools that have been used by the range-vector function.
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.
Do we need both sum
test cases?
Don't forget we also have TestConcurrentQueries
that should cover pooled slices being reused as well.
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.
one is probably sufficient. I'd suggest keeping this one (2m15s).
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.
Done, I've restored that in c4b2c57.
// Generate combinations of 2, 3, and 4 labels. (e.g., "a,b", "e,f", "c,d,e", "a,b,c,d", "c,d,e,f" etc) | ||
// Generate combinations of 2 labels. (e.g., "a,b", "e,f" etc) | ||
labelCombinations = append(labelCombinations, testutils.Combinations(labelsToUse, 2)...) | ||
labelCombinations = append(labelCombinations, testutils.Combinations(labelsToUse, 3)...) | ||
labelCombinations = append(labelCombinations, testutils.Combinations(labelsToUse, 4)...) |
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.
Rationale: these functions all operate a series at a time, and any issue working with multiple series is likely to be surfaced running with two series.
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 that. I'm in support of most of these changes, but I would like to keep the range vector tests being passed through an aggregation personally.
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.
Great, thank you :-)
* Make gauntlet tests ~3x faster by not using `t.Run()` * Don't bother running functions that operate over single series at a time over multiple series at a time * Don't run `sum` over functions that operate over range vector selectors, and only run with two series rather than up to four * Restore one `sum` over range vector function test case
* Make gauntlet tests ~3x faster by not using `t.Run()` * Don't bother running functions that operate over single series at a time over multiple series at a time * Don't run `sum` over functions that operate over range vector selectors, and only run with two series rather than up to four * Restore one `sum` over range vector function test case
* Make gauntlet tests ~3x faster by not using `t.Run()` * Don't bother running functions that operate over single series at a time over multiple series at a time * Don't run `sum` over functions that operate over range vector selectors, and only run with two series rather than up to four * Restore one `sum` over range vector function test case
* Make gauntlet tests ~3x faster by not using `t.Run()` * Don't bother running functions that operate over single series at a time over multiple series at a time * Don't run `sum` over functions that operate over range vector selectors, and only run with two series rather than up to four * Restore one `sum` over range vector function test case
What this PR does
This PR makes some improvements to the mixed metrics tests (aka the gauntlet), with the aim of preserving coverage while dramatically reducing how long they take to run.
On my machine, running all of the tests in
engine_test.go
took 3m35s before these changes, and now takes 45s.I've tried to build up these changes incrementally, I suggest reviewing each commit separately.
Which issue(s) this PR fixes or relates to
(none)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.