forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:elastic/kibana into reporting/add…
…-link-to-kibana-app * 'master' of github.com:elastic/kibana: (61 commits) [Logs UI] Fix alert previews for thresholds of `0` (elastic#111150) [Archive Migration][Partial] discover apps-discover (elastic#110437) [APM] Set start date of APM ML job to -4 weeks (elastic#111375) [ML] APM Latency Correlations: Code consolidation. (elastic#110790) [Discover] Fix indices permission for multiline test (elastic#111284) [Detection Rules] Add 7.15 rules (elastic#111464) [Security Solution][Endpoint][Host Isolation] Hide isolate host option in alert details rather than disabling (elastic#111064) React version of angular license view (elastic#111317) [APM] Fix link in readme (elastic#111362) [Security Solution] add agent field to generator (elastic#111428) [Dashboard] Retain Tags on Quicksave (elastic#111015) Reorder App Search ingestion methods (elastic#111361) Port performance docs to new docs system. (elastic#111063) [Security Solution][RAC] Fixes updatedAt loading bug (elastic#111010) [sample data] update web log geo.src field to match country code of geo.coordinates (elastic#110885) [Security solution] [Endpoint] Fix bad artifact migration (elastic#111294) Fix copy typo. (elastic#111203) [build] Remove empty optimize directory (elastic#111393) [Maps] fix term join not updating when editing right field (elastic#111030) [Fleet] Set default settings in component template instead of the index template (elastic#111197) ... # Conflicts: # x-pack/plugins/reporting/public/management/__snapshots__/report_listing.test.tsx.snap # x-pack/plugins/reporting/public/management/report_listing.test.tsx
- Loading branch information
Showing
464 changed files
with
6,674 additions
and
4,897 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
id: kibDevPerformance | ||
slug: /kibana-dev-docs/performance | ||
title: Performance | ||
summary: Performance tips for Kibana development. | ||
date: 2021-09-02 | ||
tags: ['kibana', 'onboarding', 'dev', 'performance'] | ||
--- | ||
|
||
## Keep Kibana fast | ||
|
||
*tl;dr*: Load as much code lazily as possible. Everyone loves snappy | ||
applications with a responsive UI and hates spinners. Users deserve the | ||
best experience whether they run Kibana locally or | ||
in the cloud, regardless of their hardware and environment. | ||
|
||
There are 2 main aspects of the perceived speed of an application: loading time | ||
and responsiveness to user actions. Kibana loads and bootstraps *all* | ||
the plugins whenever a user lands on any page. It means that | ||
every new application affects the overall _loading performance_, as plugin code is | ||
loaded _eagerly_ to initialize the plugin and provide plugin API to dependent | ||
plugins. | ||
|
||
However, it’s usually not necessary that the whole plugin code should be loaded | ||
and initialized at once. The plugin could keep on loading code covering API functionality | ||
on Kibana bootstrap, but load UI related code lazily on-demand, when an | ||
application page or management section is mounted. | ||
Always prefer to import UI root components lazily when possible (such as in `mount` | ||
handlers). Even if their size may seem negligible, they are likely using | ||
some heavy-weight libraries that will also be removed from the initial | ||
plugin bundle, therefore, reducing its size by a significant amount. | ||
|
||
```ts | ||
import type { Plugin, CoreSetup, AppMountParameters } from 'kibana/public'; | ||
export class MyPlugin implements Plugin<MyPluginSetup> { | ||
setup(core: CoreSetup, plugins: SetupDeps) { | ||
core.application.register({ | ||
id: 'app', | ||
title: 'My app', | ||
async mount(params: AppMountParameters) { | ||
const { mountApp } = await import('./app/mount_app'); | ||
return mountApp(await core.getStartServices(), params); | ||
}, | ||
}); | ||
plugins.management.sections.section.kibana.registerApp({ | ||
id: 'app', | ||
title: 'My app', | ||
order: 1, | ||
async mount(params) { | ||
const { mountManagementSection } = await import('./app/mount_management_section'); | ||
return mountManagementSection(coreSetup, params); | ||
}, | ||
}); | ||
return { | ||
doSomething() {}, | ||
}; | ||
} | ||
} | ||
``` | ||
|
||
### Understanding plugin bundle size | ||
|
||
Kibana Platform plugins are pre-built with `@kbn/optimizer` | ||
and distributed as package artifacts. This means that it is no | ||
longer necessary for us to include the `optimizer` in the | ||
distributable version of Kibana Every plugin artifact contains all | ||
plugin dependencies required to run the plugin, except some | ||
stateful dependencies shared across plugin bundles via | ||
`@kbn/ui-shared-deps`. This means that plugin artifacts _tend to | ||
be larger_ than they were in the legacy platform. To understand the | ||
current size of your plugin artifact, run `@kbn/optimizer` with: | ||
|
||
```bash | ||
node scripts/build_kibana_platform_plugins.js --dist --profile --focus=my_plugin | ||
``` | ||
|
||
and check the output in the `target` sub-folder of your plugin folder: | ||
|
||
```bash | ||
ls -lh plugins/my_plugin/target/public/ | ||
# output | ||
# an async chunk loaded on demand | ||
... 262K 0.plugin.js | ||
# eagerly loaded chunk | ||
... 50K my_plugin.plugin.js | ||
``` | ||
|
||
You might see at least one js bundle - `my_plugin.plugin.js`. This is | ||
the _only_ artifact loaded by Kibana during bootstrap in the | ||
browser. The rule of thumb is to keep its size as small as possible. | ||
Other lazily loaded parts of your plugin will be present in the same folder as | ||
separate chunks under `{number}.myplugin.js` names. If you want to | ||
investigate what your plugin bundle consists of, you need to run | ||
`@kbn/optimizer` with `--profile` flag to generate a | ||
[webpack stats file](https://webpack.js.org/api/stats/). | ||
|
||
```bash | ||
node scripts/build_kibana_platform_plugins.js --dist --no-examples --profile | ||
``` | ||
|
||
Many OSS tools allow you to analyze the generated stats file: | ||
|
||
* [An official tool](https://webpack.github.io/analyse/#modules) from | ||
Webpack authors | ||
* [webpack-visualizer](https://chrisbateman.github.io/webpack-visualizer/) | ||
* [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) |
17 changes: 17 additions & 0 deletions
17
...velopment/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [hasHeaderBanner$](./kibana-plugin-core-public.chromestart.hasheaderbanner_.md) | ||
|
||
## ChromeStart.hasHeaderBanner$() method | ||
|
||
Get an observable of the current header banner presence state. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
hasHeaderBanner$(): Observable<boolean>; | ||
``` | ||
<b>Returns:</b> | ||
|
||
`Observable<boolean>` | ||
|
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
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
2 changes: 1 addition & 1 deletion
2
docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
50 changes: 0 additions & 50 deletions
50
src/core/server/saved_objects/routes/integration_tests/log_legacy_import.test.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.