-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
kibana_usage_collection
: optimize SO PIT searches
#168677
kibana_usage_collection
: optimize SO PIT searches
#168677
Conversation
47e34b8
to
13c6ac7
Compare
Pinging @elastic/kibana-core (Team:Core) |
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! Thanks for the optimization improvement
savedObjectsClient.bulkDelete( | ||
usageDailyIdsToDelete.map((id) => ({ id, type: SAVED_OBJECTS_DAILY_TYPE })) |
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.
🧡
return accum; | ||
}, {} as Record<string, number>); | ||
|
||
const counts: Record<string, number> = {}; |
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.
NIT: We may be able to convert this to an ES aggregation, so there's no need to loop through all documents.
WDYT?
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.
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.
Yeah, I came to the same conclusion after I adapted the code. I wanted to try it, but in a follow-up (this one was initially supposed to be only for the usage collection calls)
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
## Summary Properly loop though PIT search pages instead of fetching all documents at once --------- Co-authored-by: Kibana Machine <[email protected]>
Summary
Properly loop though PIT search pages instead of fetching all documents at once