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

[index patterns] improve index pattern cache #83368

Merged
merged 5 commits into from
Nov 19, 2020

Conversation

mattkime
Copy link
Contributor

@mattkime mattkime commented Nov 13, 2020

Summary

Index pattern cache now stores a promise for an index pattern rather than the index pattern itself. This way we can create a cache entry at the start of the request rather than at the very end. One request is performed instead of several.

Dashboard loading is a particular example where a single index pattern can be requested many times.

Checklist

For maintainers

@mattkime mattkime requested a review from Dosant November 13, 2020 03:38
@mattkime mattkime changed the title cache index pattern promise, not index pattern [index patterns] improve index pattern cache Nov 13, 2020
@mattkime mattkime added Team:AppArch Feature:Data Views Data Views code and UI - index patterns before 8.0 v8.0.0 v7.11.0 labels Nov 13, 2020
@mattkime mattkime linked an issue Nov 13, 2020 that may be closed by this pull request
@mattkime mattkime added the release_note:skip Skip the PR/issue when compiling release notes label Nov 13, 2020
@mattkime mattkime marked this pull request as ready for review November 13, 2020 05:20
@mattkime mattkime requested a review from a team as a code owner November 13, 2020 05:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

I think there is an edge case that we can cache rejected promise and then there is no way to actually retry the request.

Probably we should also clear the rejected promise from cache

Other then that looks good to me

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

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

id before after diff
data 968.9KB 969.4KB +505.0B

History

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

Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Checked that no excessive index pattern objects fetches on a dashboard

@mattkime mattkime merged commit 4009edc into elastic:master Nov 19, 2020
mattkime added a commit to mattkime/kibana that referenced this pull request Nov 19, 2020
* cache index pattern promise, not index pattern
mattkime added a commit that referenced this pull request Nov 19, 2020
* cache index pattern promise, not index pattern
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 19, 2020
* master:
  skip "Dashboards linked by a drilldown are both copied to a space" (elastic#83824)
  [alerts] adds action group and date to mustache template variables for actions (elastic#83195)
  skip flaky suite (elastic#79389)
  [DOCS] Reallocates limitations to point-of-use (elastic#79582)
  [Enterprise Search] Engine overview layout stub (elastic#83756)
  Disable exporting/importing of templates.  Optimize pitch images a bit (elastic#83098)
  [DOCS] Consolidates plugins (elastic#83712)
  [ML] Space management UI (elastic#83320)
  test just part of the message to avoid updates (elastic#83703)
  [Data Table] Remove extra column in split mode (elastic#83193)
  Improve snapshot error messages (elastic#83785)
  skip flaky suite (elastic#83773)
  skip flaky suite (elastic#83771)
  skip flaky suite (elastic#65278)
  skip flaky suite (elastic#83793)
  [Task Manager] Ensures retries are inferred from the schedule of recurring tasks (elastic#83682)
  [index patterns] improve index pattern cache (elastic#83368)
  [Fleet] Rename ingestManager plugin ID fleet (elastic#83200)
  fixed pagination in connectors list (elastic#83638)
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Nov 19, 2020
* cache index pattern promise, not index pattern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Index Patterns] Excessive index patterns fetching on a dashboard
4 participants