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

KQL support in filter ratio in TSVB #75033

Merged
merged 17 commits into from
Aug 27, 2020

Conversation

DianaDerevyankina
Copy link
Contributor

Closes #67503

Summary

Enabled KQL support in filter ratio in TSVB

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@DianaDerevyankina DianaDerevyankina added Feature:TSVB TSVB (Time Series Visual Builder) v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Aug 14, 2020
@DianaDerevyankina DianaDerevyankina self-assigned this Aug 14, 2020
Copy link
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

see comments above

@alexwizp alexwizp added this to In progress in Kibana-app-np-migration via automation Aug 20, 2020
Copy link
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Added some nit's

@DianaDerevyankina DianaDerevyankina marked this pull request as ready for review August 20, 2020 14:46
@DianaDerevyankina DianaDerevyankina requested a review from a team August 20, 2020 14:46
@DianaDerevyankina DianaDerevyankina requested a review from a team as a code owner August 20, 2020 14:46
@DianaDerevyankina DianaDerevyankina added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Aug 20, 2020
@stratoula
Copy link
Contributor

It seems to be cut off
Screenshot 2020-08-21 at 11 08 48 AM

Do we plan to fix this here?

// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.type === 'metrics') {
const series: any[] = get(visState, 'params.series') || [];
Copy link
Contributor

@stratoula stratoula Aug 21, 2020

Choose a reason for hiding this comment

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

I assume we can't avoid these anys here, right? 😢

Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm not wrong it's SeriesItemsSchema from src/plugins/vis_type_timeseries/common/types.ts. But not sure that SeriesItemsSchema was a good name for that

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh... sorry, it's a migration script. I'm ok to see any here cause otherwise we should create a new type for each migration.

@sulemanof
Copy link
Contributor

My concern is about additional scrollbar appeared:

tsvb_filters

I assume this will be resolved by #73250
That means we need to take care of variety of cases the QueryInput component is used and finish up with final solution in #73250. I would ask for help @cchaos

Comment on lines 84 to 87
schema.object({
language: schema.string(),
query: schema.string(),
})
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a queryObject variable to replace

<EuiFieldText onChange={handleTextChange('numerator')} value={model.numerator} />
<QueryBarWrapper
query={model.numerator}
onChange={(query) => handleQueryChange('numerator', query)}
Copy link
Contributor

Choose a reason for hiding this comment

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

It is used to wrap callbacks into useCallback to avoid extra re-rendering.

  const handleNumeratorQueryChange = useCallback((query) => handleChange({ numerator: query }), [
    handleChange,
  ]);

I know this won't give a lot of effect, since the handleChange is always newly created, but you could also wrap it in useMemo. In such a case we'll make a short step into performance optimization =)

Copy link
Contributor

@sulemanof sulemanof left a comment

Choose a reason for hiding this comment

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

LGTM
Let's resolve the scrollbar issue in #73250

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

LGTM, agree with @sulemanof 🍪

@lizozom
Copy link
Contributor

lizozom commented Aug 23, 2020

@elasticmachine merge upstream

@lizozom
Copy link
Contributor

lizozom commented Aug 23, 2020

@elasticmachine merge upstream
@elasticmachine merge upstream

@lizozom
Copy link
Contributor

lizozom commented Aug 26, 2020

@elasticmachine merge upstream

const indexPattern =
(series.override_index_pattern && series.series_index_pattern) || panel.index_pattern;

const defaults = {
numerator: '*',
denominator: '*',
numerator: { query: '', language: getDefaultQueryLanguage() },
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to use data.query.getDefaultQuery() instead?

Copy link
Contributor

@lizozom lizozom left a comment

Choose a reason for hiding this comment

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

Tested and works.
Added one small request.
Otherwise LGTM

@DianaDerevyankina
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
visTypeTimeseries 1.8MB +441.0B 1.8MB

History

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

@DianaDerevyankina DianaDerevyankina merged commit 8e2cb56 into elastic:master Aug 27, 2020
Kibana-app-np-migration automation moved this from In progress to Done Aug 27, 2020
DianaDerevyankina added a commit to DianaDerevyankina/kibana that referenced this pull request Aug 27, 2020
* KQL support in filter ratio in TSVB

Closes elastic#67503

* Fix filter_ratio and filter_ratios tests

* fix JEST

* Refactor some code in filter_ratio, filter_ratios, filter_ratios.test

* Edit query value in filter_ratio and filter_ratios.test

* Refacor some code in filter_ratio.js and visualization_migrations.ts

* Remove duplications in vis_schema and refactor filter_ratio

* Refactor filter_ratio.js

* Update default query with getDefaultQuery()

* Fix filter_ratio and histogram_support tests

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
DianaDerevyankina added a commit that referenced this pull request Aug 27, 2020
* KQL support in filter ratio in TSVB

Closes #67503

* Fix filter_ratio and filter_ratios tests

* fix JEST

* Refactor some code in filter_ratio, filter_ratios, filter_ratios.test

* Edit query value in filter_ratio and filter_ratios.test

* Refacor some code in filter_ratio.js and visualization_migrations.ts

* Remove duplications in vis_schema and refactor filter_ratio

* Refactor filter_ratio.js

* Update default query with getDefaultQuery()

* Fix filter_ratio and histogram_support tests

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@wylieconlon wylieconlon added release_note:enhancement and removed release_note:skip Skip the PR/issue when compiling release notes labels Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
Development

Successfully merging this pull request may close these issues.

KQL support in filter ratio in TSVB
8 participants