-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 sizes of assets produced by optimizer #71319
Merged
spalger
merged 18 commits into
elastic:master
from
spalger:implement/asset-size-metrics
Jul 15, 2020
Merged
[kbn/optimizer] report sizes of assets produced by optimizer #71319
spalger
merged 18 commits into
elastic:master
from
spalger:implement/asset-size-metrics
Jul 15, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spalger
added
Team:Operations
Team label for Operations Team
v8.0.0
release_note:skip
Skip the PR/issue when compiling release notes
v7.9.0
labels
Jul 9, 2020
tylersmalley
reviewed
Jul 9, 2020
4 tasks
Pinging @elastic/kibana-operations (Team:Operations) |
29 tasks
17 tasks
@elasticmachine merge upstream |
@elasticmachine merge upstream |
LGTM I can't recall if we currently do any filtering to the |
tylersmalley
approved these changes
Jul 14, 2020
That's correct |
…ana into implement/asset-size-metrics
💚 Build SucceededBuild metricsasync chunks size
miscellaneous assets size
page load bundle size
History
To update your PR or re-run it, just comment with: |
spalger
pushed a commit
to spalger/kibana
that referenced
this pull request
Jul 15, 2020
…#71319) * Revert "Report page load asset size (elastic#66224)" This reverts commit 6f57fa0. * [kbn/optimizer] report sizes of assets produced by optimizer * coalese the fast-glob versions we're using to prevent additional installs * update kbn/pm dist * Revert "update kbn/pm dist" This reverts commit 68e24f0. * Revert "coalese the fast-glob versions we're using to prevent additional installs" This reverts commit 4201fb6. * remove fast-glob, just recursivly call readdirSync() * update integration tests to use new chunk filename Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> # Conflicts: # packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts # yarn.lock
This was referenced Jul 21, 2020
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
v8.0.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #66224 we attempted to capture the file size of all assets which are loaded when you access any page in Kibana. This includes styles, font, images, js, and async js chunks which are consistently loaded simply by visiting any page of Kibana. We did this by creating a custom FTR config which started Kibana with some basic data, then using Puppeteer and the Chrome DevTools protocol to load up a handful of pages and inspecting the network requests which happen on all of the pages. It turns out the CDP does not have a mechanism for getting the uncompressed sizes of assets loaded in the browser (compression is surprisingly non-deterministic) and the mechanism we ended up using seems to rely on events that don't get delivered reliably enough.
This PR reverts #66224 and replaces it with simple analysis of the files produced by the optimizer. It doesn't track assets like the size of EUI styles, images, fonts, etc. But it does track three new metrics:
page load bundle size
, the size of the "entry" bundle for each plugin, this will always be loaded on every page by the platform/server and includes all code that is synchronously imported from thepublic/index
file of a pluginasync chunks size
, the sum size of all the asynchronously loaded chunks that a bundle creates by usingasync import()
statements in their code. It's unknown which of these chunks load when, and that can change at any moment, but it can generally be assumed that thepage load bundle size
+async chunks size
represents the total JS produced by a single plugin.miscellaneous assets size
, this represents the sum size of other assets created by a bundle which aren't simply TS/JS and can include images, fonts, or other assets which are configured at the import site. We don't have much visibility into these assets but it is assumed that plugins will load them at some time so we want to keep an eye on how their size changes over time.