Skip to content
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: subqueries #9664

Merged
merged 23 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
58bc4a1
Enable upstream tests
charleskorn Oct 17, 2024
f4421f7
Add benchmark
charleskorn Oct 17, 2024
ab68d7e
Introduce feature toggle
charleskorn Oct 17, 2024
9a0372d
Don't assume all operators are running at the top level of a query
charleskorn Oct 17, 2024
f552373
Add ability to reuse an existing point slice for a ring buffer
charleskorn Oct 17, 2024
7fc1348
Add `Release` method to ring buffers
charleskorn Oct 17, 2024
90a2d8d
Introduce range query tests
charleskorn Oct 17, 2024
afa52a2
Bring in TestSubquerySelector from Prometheus
charleskorn Oct 17, 2024
cc200b8
Change `RangeVectorOperator.NextStepSamples` to return ring buffers r…
charleskorn Oct 17, 2024
07842b3
Refactor `TestSubqueries`
charleskorn Oct 18, 2024
0c4eebb
Initial (largely working) implementation
charleskorn Oct 18, 2024
39c15b6
Fix handling of @
charleskorn Oct 18, 2024
8c06a74
Enable newly supported upstream test cases
charleskorn Oct 18, 2024
787630a
Add further benchmark
charleskorn Oct 18, 2024
72bd91d
Add changelog entry
charleskorn Oct 18, 2024
3802b09
Merge branch 'main' into charleskorn/mqe-subqueries
charleskorn Oct 20, 2024
871dd6e
Address PR feedback: clarify comments
charleskorn Oct 21, 2024
c28cd84
Add tests for ring buffer `Release` implementations
charleskorn Oct 21, 2024
489fe40
Address PR feedback: update comment to match new behaviour
charleskorn Oct 21, 2024
6920206
Address PR feedback: fix indentation
charleskorn Oct 21, 2024
ac84802
Expand native histogram tests
charleskorn Oct 21, 2024
220e5de
Add test for deeply nested subqueries with changing step.
charleskorn Oct 21, 2024
deb30ad
Run test cases in TestSubqueries against Prometheus' engine too.
charleskorn Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/streamingpromql/testdata/ours/subqueries.test
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,18 @@ eval_warn range from 0 to 5m step 1m sum_over_time(last_over_time(metric[2m:1m])
{type="histograms"} {{count:0}} {{count:0}} {{count:4}} {{count:10}} {{count:10}} {{count:9}}
{type="mixed"} 0 0 4 10 10 _
# Last sample for {type="mixed"} dropped due to mixture of floats and histograms

clear

# Test deeply nested subquery with changing step.
load 1m
metric 0 1 2 3 4

eval range from 0 to 4m step 15s sum_over_time(metric[2m:30s])
{} 0 0 0 0 1 1 2 2 4 4 6 6 9 8 11 10 14

eval range from 0 to 4m step 20s sum_over_time(sum_over_time(metric[2m:30s])[3m:15s])
{} 0 0 0 1 2 4 10 14 20 35 43 54 78

eval range from 0 to 4m step 3m sum_over_time(sum_over_time(sum_over_time(metric[2m:30s])[3m:15s])[4m:20s])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turtles all the way down

{} 0 86
Loading