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

[kbn/optimizer] report limits with ci metrics #78205

Merged
merged 16 commits into from
Oct 7, 2020

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Sep 22, 2020

Closes #74285

In an attempt to prevent bundles from unexpectedly growing in size we would like to implement hard limits on the size of bundles. To assist in that effort we're going to start by giving every bundle a 5kb budget for increasing, and will work to clamp down the limit over time. Ideally we will get to a point where all page load bundles are less than 200kb.

To accomplish this we have a limits.yml file that describes the max size in bytes for each bundle. These limits are sent to the ci-stats service when metrics are reported along with the current size, allowing the service to set a failed commit status on the PR as well as report the remaining budget for each bundle so we can track this stat over time as well.

The limits file can be validate locally by running

node scripts/build_kibana_platform_plugins --validate-limits

The limits file can also be regenerated locally by running

node scripts/build_kibana_platform_plugins --update-limits

which runs a build locally and writes the sizes + 5kb to limits.yml

@spalger spalger added Team:Operations Team label for Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Sep 22, 2020
@spalger spalger force-pushed the implement/bundle-metric-limits branch 5 times, most recently from 1724549 to d0fcd8a Compare September 25, 2020 03:24
@spalger spalger force-pushed the implement/bundle-metric-limits branch from d7e3a96 to 4f6a5ee Compare October 1, 2020 00:30
@spalger spalger mentioned this pull request Oct 1, 2020
@spalger spalger force-pushed the implement/bundle-metric-limits branch from 4f6a5ee to e55a260 Compare October 1, 2020 21:48
@spalger
Copy link
Contributor Author

spalger commented Oct 1, 2020

Example comment from CI with failures:

💔 Build Failed

Metrics [docs]

@kbn/optimizer bundle module count

id value diff baseline
timelion 103 +1 102

async chunks size

id value diff baseline
enterpriseSearch 430.1KB +1.0B 430.1KB
timelion 455.5KB +1.0B 455.5KB
total +2.0B

distributable file count

id value diff baseline
default 45873 +43 45830
oss 26589 +36 26553

page load bundle size

id value diff baseline errors
beatsManagement 439.8KB +723.0B 439.1KB
ingestManager 510.5KB +723.0B 509.8KB
timelion 23.1KB +8.5KB 14.6KB ❌ 3.6KB over limit
upgradeAssistant 64.8KB +1.0B 64.8KB
total +9.9KB

History

  • 💔 Build #78496 failed d7e3a9627df1cc44a754392ad8b409c79d4c10da
  • 💔 Build #77220 failed 74511eb8049ce0074f41d6329b908bf2eef13d61
  • 💔 Build #77192 failed 9648b73a6cd8ce6a04dcbc80a34751a080c434ed
  • 💚 Build #77187 succeeded 30f41a9bc2de5df53d5bf0b827021a5f4b025652
  • 💚 Build #77181 succeeded d0fcd8ac859a6b0763901d8c52f4d18fd5d0bd20

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

@spalger spalger force-pushed the implement/bundle-metric-limits branch from e55a260 to 5e091e4 Compare October 1, 2020 23:00
@spalger spalger marked this pull request as ready for review October 1, 2020 23:31
@spalger spalger requested a review from a team as a code owner October 1, 2020 23:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@brianseeders
Copy link
Contributor

@kibanamachine merge upstream

@elastic elastic deleted a comment from kibanamachine Oct 2, 2020
@elastic elastic deleted a comment from kibanamachine Oct 2, 2020
@spalger spalger force-pushed the implement/bundle-metric-limits branch from 5602d8d to daf6578 Compare October 4, 2020 08:17
@spalger spalger force-pushed the implement/bundle-metric-limits branch from daf6578 to 087c85f Compare October 4, 2020 08:20
@spalger
Copy link
Contributor Author

spalger commented Oct 5, 2020

@elasticmachine merge upstream

@spalger spalger force-pushed the implement/bundle-metric-limits branch from c323ffb to 1a5b08f Compare October 5, 2020 23:06
}

const ext = Path.extname(filename);
if (IGNORED_EXTNAME.includes(ext)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to specifically include js instead of maintain an ignore list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The files aren't just js files, they include images, fonts, etc, so I think the ignore list is more appropriate.

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

LGTM

@tylersmalley
Copy link
Contributor

tylersmalley commented Oct 7, 2020

@elasticmachine merge upstream

Failure caused by #79725

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@spalger spalger merged commit fd066f7 into elastic:master Oct 7, 2020
@spalger spalger deleted the implement/bundle-metric-limits branch October 7, 2020 22:43
@spalger spalger added the v7.11.0 label Oct 7, 2020
spalger added a commit to spalger/kibana that referenced this pull request Oct 7, 2020
spalger added a commit to spalger/kibana that referenced this pull request Oct 7, 2020
spalger added a commit that referenced this pull request Oct 8, 2020
* [kbn/optimizer] report limits with ci metrics (#78205)

Co-authored-by: spalger <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>

* update bundle limits for 7.x branch

Co-authored-by: spalger <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
spalger added a commit that referenced this pull request Oct 8, 2020
* [kbn/optimizer] report limits with ci metrics (#78205)

Co-authored-by: spalger <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>

* update bundle limits for 7.10

Co-authored-by: spalger <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Oct 8, 2020
* master: (217 commits)
  Fix dashboard "snapshot share" is not sharing panel state in view mode (elastic#79837)
  fix can't edit a scripted field with special char (elastic#79842)
  [ML] clear selection action (elastic#79834)
  [TSVB] Show tooltip on external pointer events (elastic#77306)
  Fixes bug where the same index was being passed in (elastic#79949)
  Adds date time query and return fields for timestamps and overrides (elastic#79911)
  [Security Solution][Detections] Reverts rules table tag filter to use AND operator (elastic#79920)
  add the correct class to truncate the names (elastic#79921)
  [kbn/optimizer] report limits with ci metrics (elastic#78205)
  [release notes] extract "dev docs" comment too (elastic#79351)
  Revert "skips test failing promotion (elastic#79777)" (elastic#79904)
  share tslib across bundles (elastic#79915)
  remove entire suite as partial skips aren't doing the trick
  skip flaky suite (elastic#78689)
  Skip failing suite (elastic#79522)
  skip flaky suite (elastic#79910)
  [es/mappings] remove doc_values from text fields (elastic#79869)
  remove skipped snapshots
  skip flaky tests (elastic#79891)
  chore(NA): add missing branches into backportrc configuration file (elastic#79848)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.10.0 v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a plugin entry point bundle size budget
5 participants