-
Notifications
You must be signed in to change notification settings - Fork 8.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
[Lens] optimize duplicate metric operations #140764
[Lens] optimize duplicate metric operations #140764
Conversation
add automated test
6d8f8c3
to
8988e38
Compare
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
There's something strange happening somewhere here as I've noticed this weird behaviour:
Cannot replicate the same behaviour in |
@dej611 good find! 😬 I'll look into this. |
@dej611 I'm having trouble reproducing that issue. I copied your formula, but it appears to work. Could you share any more details? The error must originate here, but I haven't figured out how to get it to throw
|
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.
Works pretty well, left a comment about a further opportunity to optimize but that can be split out. I also don't know how Marco caused this error, but it would be nice to reproduce. @dej611 if you can still cause it can be share your config? Maybe it's about a certain combination with bucket aggs?
x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: |
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 has the same problem the percentile optimization had - if a column is referenced for sorting by top values, it's failing because the column won't exist. In this case Filter 1
and Filter 2
are both a sum of bytes filtered the same way.
Ranking by Filter 2
works fine byt ranking by Filter 1
breaks because that column got optimized away.
This is a constructed example, but the same thing can happen if there is a regular metric dimension used for ranking plus a formula dimension which is internally using the same metric on the same chart.
Closing in favor of a more holistic PR: #140859 |
I managed to reproduce it also in If I remove the Edit: just found out that the time range picked is important to reproduce the bug: set the time picker to come custom date range with no data and the error will appear. |
Summary
Part of #135265
Testing
Create a visualization and add a dimension with this formula
Check the Elasticsearch request in the inspector. There should only be 7 aggregations, not 14.
Then try this formula
Check the Elasticsearch request in the inspector. There should only be 5 aggregations, not 10.
Checklist
Delete any items that are not applicable to this PR.