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

[SOM] use aggregation for type counts #168918

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

pgayvallet
Copy link
Contributor

Summary

Use an aggregation for type counts in SO management instead of scrolling through all the documents.

@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes v8.12.0 labels Oct 16, 2023
Comment on lines +39 to +42
const counts = buckets.reduce((memo, bucket) => {
memo[bucket.key] = bucket.doc_count;
return memo;
}, {} as Record<string, number>);
Copy link
Contributor Author

@pgayvallet pgayvallet Oct 16, 2023

Choose a reason for hiding this comment

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

We have API integration FTR tests for this endpoint:

describe('scroll_count', () => {
describe('with less than 10k objects', () => {

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

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

@pgayvallet pgayvallet marked this pull request as ready for review October 16, 2023 10:55
@pgayvallet pgayvallet requested a review from a team as a code owner October 16, 2023 10:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

👏🏻

@pgayvallet pgayvallet merged commit 0c1f828 into elastic:main Oct 17, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 17, 2023
dej611 pushed a commit to dej611/kibana that referenced this pull request Oct 17, 2023
## Summary

Use an aggregation for type counts in SO management instead of scrolling
through all the documents.

---------

Co-authored-by: kibanamachine <[email protected]>
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:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants