elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.33k stars 7.97k forks source link

[ML] Transforms: Improve data view checks. #181892

Open walterra opened 1 week ago

walterra commented 1 week ago

Summary

Part of #181603.

For some of the actions in the transform list we need to identify if there's a data view for the target index. The way we identified this was quite inefficient. We had poor caching in place and fetched info for all data views including fields — this can be quite expensive queries!

This update fixes the approach and switches to using dataViews.getIdsWithTitle() in combination with useQuery() to bring the caching in line with how we load and refresh the rest of the transform list.

Before: Lots of field caps requests!

image

After: We do just 1 _search request that gets the data view ids/titles:

image

Checklist

elasticmachine commented 5 days ago

Pinging @elastic/ml-ui (:ml)

kibana-ci commented 21 hours ago

:green_heart: Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
transform 441 442 +1

Async chunks

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

id before after diff
transform 393.6KB 393.4KB -267.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
transform 18.8KB 18.8KB +70.0B
Unknown metric groups #### ESLint disabled line counts | id | [before](https://github.com/elastic/kibana/commit/c6ff9caa6f45e86767598e0183cc199f92e16fb7) | [after](https://github.com/elastic/kibana/commit/928e66c384978bba53b25a8c4a8f9c9a6a3476d3) | diff | | --- | --- | --- | --- | | `transform` | 32 | 31 | -1 | #### Total ESLint disabled count | id | [before](https://github.com/elastic/kibana/commit/c6ff9caa6f45e86767598e0183cc199f92e16fb7) | [after](https://github.com/elastic/kibana/commit/928e66c384978bba53b25a8c4a8f9c9a6a3476d3) | diff | | --- | --- | --- | --- | | `transform` | 36 | 35 | -1 |

History

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

cc @walterra