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] Consolidate redundant time_buckets into @kbn/ml-time-buckets. #178756

Merged
merged 16 commits into from
Mar 20, 2024

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Mar 14, 2024

Summary

Follow up to #46227.

Consolidates multiple copies of time_buckets.js into @kbn/ml-time-buckets. The scope of this PR is just to consolidate the files. In follow ups we still need to: Refactor JS to TS and get rid of the code that uses this using "dependency cache" in the ml plugin.

Checklist

@walterra walterra force-pushed the ml-aiops-package-common branch from be21b4b to bb0264c Compare March 14, 2024 17:50
@walterra walterra self-assigned this Mar 14, 2024
@walterra walterra added :ml v8.14.0 release_note:skip Skip the PR/issue when compiling release notes labels Mar 14, 2024
@walterra walterra marked this pull request as ready for review March 14, 2024 19:10
@walterra walterra requested a review from a team as a code owner March 14, 2024 19:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)


import { isTimeSeriesViewJob } from '../../../../common/util/job_utils';
import { parseInterval } from '../../../../common/util/parse_interval';

import { getBoundsRoundedToInterval, getTimeBucketsFromCache } from '../../util/time_buckets';
import { getTimeBucketsFromCache } from '../../util/get_time_buckets_from_cache';
Copy link
Contributor

Choose a reason for hiding this comment

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

This file will be removed via #178566
but good catch on creating a separate file for getTimeBucketsFromCache for settings.ts which still uses it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know, let's get yours in first and then see if I get any conflicts with this one.

@alvarezmelissa87
Copy link
Contributor

Code LGTM - will give it a test tomorrow and update. Nice piece of work! 🙏

@qn895
Copy link
Member

qn895 commented Mar 19, 2024

Tested the following and functionally had no issues:

  • Anomaly detection creation and explorer
  • Anomaly detection embeddables in Dashboard
  • File upload
  • Index data visualizer
  • Change point detection

Code also LGTM 🎉

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 464 466 +2
dataVisualizer 632 634 +2
ml 1946 1949 +3
total +7

Async chunks

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

id before after diff
aiops 404.5KB 404.7KB +187.0B
dataVisualizer 653.6KB 652.7KB -974.0B
ml 3.7MB 3.7MB +1.9KB
total +1.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 78.5KB 78.3KB -150.0B
Unknown metric groups

API count

id before after diff
@kbn/ml-time-buckets - 34 +34

History

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

cc @walterra

@walterra walterra merged commit be9ad68 into elastic:main Mar 20, 2024
33 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 20, 2024
@walterra walterra deleted the ml-aiops-package-common branch March 20, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting :ml release_note:skip Skip the PR/issue when compiling release notes v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants