elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.72k stars 8.13k forks source link

[ML] Anomaly Explorer excessive API calls #124696

Open darnautov opened 2 years ago

darnautov commented 2 years ago

Anomaly Explorer page performs too many redundant API calls during initial load and some UI interactions. Some examples:

  1. Open Anomaly Explorer from the Anomaly Detection Job list page (open_anomaly_explorer.har.zip)
  2. Selecting a cell on the Overall swim lane invoke 24 API calls (click_overall_swim_lane.har.zip)
  3. Each pagination change on the View By swim lane triggers fetching of 500 anomaly records 🤔 (view_by_swim_lane_pagination.har.zip)

There are several things that need to be done to improve the overall performance of the page.

Break down the app state

At the moment one massive state is responsible for keeping track of all components state and fetching the data. Instead, each component should manage its own state and fetch the necessary data

The minimum amount of required shared data should live in the common state.

Dedicated API endpoints

It will reduce the size of ongoing requests, the complexity of client-side operations and should help with tracking the network activity.

elasticmachine commented 2 years ago

Pinging @elastic/ml-ui (:ml)