-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] AIOps: Refactors function argument structure for Log Rate Analysis. #187669
Conversation
Pinging @elastic/ml-ui (:ml) |
7198b48
to
be4457b
Compare
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Any counts in public APIs
History
cc @walterra |
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.
Code LGTM - a nice refactor to make the code easier to read.
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 ⚡
…189863) ## Summary Follow up to #187669. Part of #187684. Fixes #176387. (Ran the flaky test runner on AIOps functional tests) - Fixes the `size: 0` option to be properly nested for `createCategoryRequest()`. - Changes the arguments structure for `fetchTopCategories` and `fetchTopTerms` from individual arguments to an options object to be more in line with the other functions used for log rate analysis. - Adds jest unit test for `fetchTopCategories` and `fetchTopTerms`. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Summary
Part of #178613.
Refactors the function argument structure of code used on Kibana server for Log Rate Analysis from individual arguments to single objects that contain all options. The options structure looks like this:
The main benefit is that code where these functions are used become easier to read. Instead of the strict order of args that sometimes included
undefined
or just a value where it's hard to guess for which argument it's used for, this enforces to have the names of options show up in the consuming code. Here's an example:Before:
After:
Checklist