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

[Lens] prompt user when editor performance is impacted #158321

Open
drewdaemon opened this issue May 23, 2023 · 2 comments
Open

[Lens] prompt user when editor performance is impacted #158321

drewdaemon opened this issue May 23, 2023 · 2 comments
Labels
Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@drewdaemon
Copy link
Contributor

drewdaemon commented May 23, 2023

Describe the feature:
We implemented the ability to hide Lens suggestions and disable auto-apply in order to improve editor performance.

Both of these can significantly improve the situation, but disabling auto-apply is hidden in our settings menu and hiding the suggestions may not be an obvious action to the user (e.g. they may not understand that the suggestions are contributing to the slow experience).

Can we detect bad performance and prompt the user with these options?

Screenshot 2022-03-18 at 09 24 35

Some context on the problem

Source of bad performances have been identified so far in the following areas:

  1. Suggestions
  2. suggestion requests might take a long time to complete and the editor will still hang up until the last suggestion has completed to render
  3. rendering can be slow in some very specific conditions (mostly super high cardinality bucketing + breakdowns).
  4. Dimension editing
  5. Some dimension controls are not correctly debounced and might add up to other changes providing a degradated experience to the user.

So far the suggestion request has been the major problem here, leading to several changes in the past who improved the local situation, but still targeting specific workarounds rather than the general problem:

Attacking the general problem

Some ideas have been brought to the table in some discussion to tackle the general problem and here's a summary of them:

  • Use some sampling strategy to reduce the request time for suggestions
    • [Lens] Support Sampler & Diversified Sampler aggregations #120788 - while this specific issue require us to implement the support for these two agg types in Lens, there's today the option to leverage also the random sampler for suggestions which is already implemented.
    • an alternative approach would be to reuse - where possible - the current dataset with a client-side down-sampling approach.
  • Reduce the configuration to smaller cardinality where possible
    • Similar idea to the sampling one, but this one works on the bucketing cardinality in case of high buckets/breakdown by dimensions
  • Bail out of slow suggestions
@drewdaemon drewdaemon added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels May 23, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@drewdaemon drewdaemon added the impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. label May 23, 2023
@timductive timductive added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels May 31, 2023
@drewdaemon
Copy link
Contributor Author

drewdaemon commented Jun 1, 2023

From our discussion, these slowdowns can be caused by either network-bound or CPU-bound processes.

Network requests are async, so network-bound slowdowns could theoretically be detected and remediated (notification to user, cancellation of the request, etc) before the response is received.

Rendering (CPU-bound) is currently synchronous so detecting and applying performance remediation strategies mid-render is difficult (impossible as things currently stand?). However, it occurs to me that the detection can always be applied after a long render has been completed as well.

Sure, it would be better if we could do it before render completion, but detecting a performance degradation is a win no matter what IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants