-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[ML] Data view loading refactor #116455
[ML] Data view loading refactor #116455
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/ml-ui (:ml) |
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.
Tested and overall looks good. Just left a few minor comments.
...ugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
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.
Latest changes LGTM
💛 Build succeeded, but was flaky
Test Failures
Metrics [docs]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.
LGTM ⚡
* [ML] Data view loading refactor * more renaming * more renaming * fixing tests * fixing jest test * small changes based on review Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
1 similar comment
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
* [ML] Data view loading refactor * more renaming * more renaming * fixing tests * fixing jest test * small changes based on review Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: James Gowdy <jgowdy@elastic.co>
…147916) Fixes #147886 by manually checking whether the index behind a data view actually exists before fetching it. This fixes the issue with the data view service which displays a toast for every data view which it cannot load the fields for. This fix has the potential to increase the amount of requests to es by quite a large amount. For example, if a user has 100 data views, 80 of which have existing indices. 1 request is made to load all data view ids and titles 100 requests are made to fetch the fields for each index. 80 succeed. 80 requests are then made to fetch each data view. In 8.0 this behaviour has been [changed](#116455). We no longer request all of the data views up front on page load.
Removes the cache of data views (
indexPatternCache
) which was populated on first page load of a number of ML pages. Loaded via the client side router.Our recent change to the data view service's
find
function using a wildcard to load every data view was causing excessive calls to the_fields_for_wildcard
, one for each requested data view.Previously we had been using the saved object service's find function which did not also load all of the fields for each requested data view.
This PR removes this call to
find
as almost all places where the cache was being used, the full data view saved objects with fields were not needed, rather a list of data view names or a match of name to id.These have been now all been changed to async calls to the real data view data via the data view service.
The rest of the changes in this PR are variable and function identifier changes, index pattern -> data view.
There are still a lot remaining "index patterns" in our code base that I have left be, so not to double the size of this PR and lose focus of the
_fields_for_wildcard
problem it is solving.Unit or functional tests were updated or added to match the most common scenarios
This was checked for breaking API changes and was labeled appropriately