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

[ML] Performance improvements to annotations editing in Single Metric Viewer & buttons placement #83216

Merged
merged 20 commits into from
Nov 18, 2020

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Nov 11, 2020

Summary

This PR addresses a performance issue which cause typing in the annotation flyout editor in Single Metric View to be slow and unresponsive when typing fast. Follow up of #72299.

  • Previously, renderFocusChart() will be called with every keystroke. This PR fixes this issue.

Screen Shot 2020-11-11 at 14 52 40

  • Before
    typing_furiously_before

  • After
    typing_furiously

  • It also updates the button placement in the footer to match with Kibana's design convention [ML] Anomaly Detection: Annotations enhancements #70198 (comment).

  • Before
    Screen Shot 2020-11-11 at 15 23 35

  • After
    Screen Shot 2020-11-11 at 14 58 49

  • Previously, switching from the Single Metric Viewer to the Anomaly Explorer and vice versa will keep persisting the annotation fly-out. This PR fixes so that there are three separate AnnotationUpdatesService instances for the job list, the Single Metric Viewer, and the Anomaly Explorer page.

  • Before
    2020-11-17 at 13 18

  • After
    no_more_persisting_flyout

Checklist

Delete any items that are not applicable to this PR.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

LGTM

@qn895 qn895 requested a review from a team as a code owner November 12, 2020 21:57
@qn895 qn895 requested a review from darnautov November 17, 2020 00:21
Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

Great job with AnnotationUpdatesService, just some minor issues around one method need to be resolved


test('Update button is disabled with empty annotation', () => {
const annotationUpdatesService = new AnnotationUpdatesService();
Copy link
Contributor

Choose a reason for hiding this comment

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

you should instantiate a service in before hook

Copy link
Contributor

Choose a reason for hiding this comment

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

@qn895 inside of describe('AnnotationFlyout', () => {
creating the following

let annotationUpdatesService: AnnotationUpdatesService = null

beforeEach(() => {
  annotationUpdatesService = new AnnotationUpdatesService();
})

to make sure each test is isolated

Copy link
Member Author

Choose a reason for hiding this comment

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

My apologies - missed this comment yesterday. Updated here: 9b8020b

@darnautov
Copy link
Contributor

@qn895 I see you've created a context, but you haven't provided a value itself using Provider of this context. For some reason, you only did it for unit tests :)

@qn895
Copy link
Member Author

qn895 commented Nov 17, 2020

@qn895 I see you've created a context, but you haven't provided a value itself using Provider of this context. For some reason, you only did it for unit tests :)

Thanks. I have added the AnnotationUpdatesProvider here 2165da7 instead of using the default static instance.

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 1565 1566 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 5.2MB 5.2MB +3.9KB

History

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

@qn895 qn895 merged commit 7a7057e into elastic:master Nov 18, 2020
@qn895 qn895 deleted the ml-annotations-smv-improvements branch November 18, 2020 16:49
qn895 added a commit to qn895/kibana that referenced this pull request Nov 18, 2020
qn895 added a commit that referenced this pull request Nov 18, 2020
phillipb added a commit to phillipb/kibana that referenced this pull request Nov 18, 2020
…o-node-details

* 'master' of github.com:elastic/kibana:
  [ML] Performance improvements to annotations editing in Single Metric Viewer & buttons placement (elastic#83216)
  [Metrics UI] Add Process tab to Enhanced Node Details (elastic#83477)
phillipb added a commit to phillipb/kibana that referenced this pull request Nov 19, 2020
… into add-logs-to-node-details

* 'add-logs-to-node-details' of github.com:phillipb/kibana: (87 commits)
  [Maps] Add 'crossed' & 'exited' events to tracking alert (elastic#82463)
  Updating code-owners to use new core/app-services team names (elastic#83731)
  Add Managed label to data streams and a view switch for the table (elastic#83049)
  [Maps] Add query bar inputs to geo threshold alerts tracked points & boundaries (elastic#80871)
  fix(NA): search examples kibana version declaration (elastic#83182)
  Fixed console error, which appears when saving changes in Edit Alert flyout (elastic#83610)
  [Alerting] Add `alert.updatedAt` field to represent date of last user edit (elastic#83578)
  Not resetting server log level if level is defined (elastic#83651)
  disable incremenetal build for legacy tsconfig.json (elastic#82986)
  [Workplace Search] Migrate SourceLogic from ent-search (elastic#83593)
  [Workplace Search] Port Box changes from ent-search (elastic#83675)
  [APM] Improve router types (elastic#83620)
  Bump flat to v4.1.1 (elastic#83647)
  Bump y18n@5 to v5.0.5 (elastic#83644)
  Bump jsonpointer to v4.1.0 (elastic#83641)
  Bump is-my-json-valid to v2.20.5 (elastic#83642)
  [Telemetry] Move Monitoring collection strategy to a collector (elastic#82638)
  Update typescript eslint to v4.8 (elastic#83520)
  [ML] Persist URL state for Anomaly detection jobs using metric function (elastic#83507)
  [ML] Performance improvements to annotations editing in Single Metric Viewer & buttons placement (elastic#83216)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants