Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Synthetics] Improve overview page performance !! (#201275)
## Summary Improve overview page performance !! Right now UI works for few hundred to 1000 monitors, but it starts degrading after that, this PR makes sure, we refactor queries in such a way that it scale up to 10k-20k monitors easily. ### Queries before Before this PR, we were doing 2 steps queries, first fetch all saved objects and the fetch all summary documents by passings all ids from first phase. This meant that let's say if we have 20k saved objects, first we will need to page through all of them to even start fetching summaries. To fetch summary documents, we were using `top_hits` query which can be memory expensive. ### Queries now In this PR we fetch summaries and saved objects in parallel, since we have space id on documents as well, there was no need to do 2 step queries. Now we fetch both things in parallel and then we hydrate saved object data from summary data. In this PR now we are using top_metrics query to fetch each monitor status instead of `top_hits` I tested on about 20k monitors, app performs reasoably well after the PR <img width="1920" alt="image" src="https://github.com/user-attachments/assets/c143e196-59a4-45b4-86b7-bd22ac4c5d4b"> On a very slow cluster on which kibana is local against a remote cluster ### After <img width="1920" alt="image" src="https://github.com/user-attachments/assets/540d0cdf-2f8c-44d1-af76-81953d9ca0ff"> ### Before <img width="1918" alt="image" src="https://github.com/user-attachments/assets/5fdc314d-bb59-4137-9397-d8aee6bd4806"> --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information