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

[TSVB2Lens] Support top_hit of size 1 aggregation #125766

Merged
merged 4 commits into from
Feb 17, 2022

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Feb 16, 2022

Summary

Part of #125539

It adds support for TopHit aggregations with size 1. The layer is translated to a quick function last_value.

image

image

Checklist

@stratoula stratoula added Feature:Lens Feature:TSVB TSVB (Time Series Visual Builder) release_note:skip Skip the PR/issue when compiling release notes v8.2.0 backport:skip This commit does not require backporting labels Feb 16, 2022
@stratoula stratoula marked this pull request as ready for review February 16, 2022 12:39
@stratoula stratoula requested a review from a team as a code owner February 16, 2022 12:39
@stratoula stratoula added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Feb 16, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

Quick question - you chose to convert it to formula, why not last_value quick function? That would give the extra option to pass Order by -> Sort by date field. Also, I am wondering maybe we should block support when the order is set to ascending, because in Lens we only support last value but not first value (so when we have sorting order set to ascending the chart is different)

Apart from that, why they differ so much? I do not understand 😅 EDIT- I do understand now, it's the time interval that is different (second image corrects it)
Screenshot 2022-02-17 
at 11 15 37
Screenshot 2022-02-17 at 11 19 12

dash.ndjson.zip

@flash1293
Copy link
Contributor

@mbondyra The Lens one is using 3 hour buckets, the tsvb is using 4 hour buckets due to the different "auto" interval behavior.

@flash1293
Copy link
Contributor

Agree about using the quick function for this if possible would be better to stay consistent.

Also, I know I came up with this idea but I realized it's actually not completely identical - TSVB is able to handle last value of a multi value by using the provided aggregation function, but Lens will show a warning. I think it's still fine to do this conversion as there are other small differences, just wanted to note.

@stratoula
Copy link
Contributor Author

@elasticmachine merge upstream

@stratoula
Copy link
Contributor Author

@mbondyra @flash1293 I replaced it to work with the quick function and not allow it for asc.I don't have a strong opinion on supporting this transaction or not. It works only for size 1, order desc and displays a warning in Lens for multi values.
I see advantages on supporting it but I agree that it might not add great value to the feature :)
Whatever you want, I am comfortable with both options (supporting or not supporting)

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

Retested and works as expected. I don't have a strong opinion too, just wondering. I think what would help is if we add this option in Lens, if users actually use it :)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.1MB 1.1MB +34.0B
visTypeTimeseries 462.2KB 462.7KB +495.0B
total +529.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@stratoula
Copy link
Contributor Author

Ok I will merge it then :) I don't think that it hurts anyone even if it might support very few TSVB to Lens transitions :)

@stratoula stratoula merged commit 0d23491 into elastic:main Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Lens Feature:TSVB TSVB (Time Series Visual Builder) release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants