-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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' into index_pattern_edit_field_formatter
- Loading branch information
Showing
98 changed files
with
1,916 additions
and
942 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
pageLoadAssetSize: | ||
advancedSettings: 27_596 | ||
alerts: 106_936 | ||
apm: 64_385 | ||
apmOss: 18_996 | ||
beatsManagement: 188_135 | ||
bfetch: 41_874 | ||
canvas: 1_066_647 | ||
charts: 159_211 | ||
cloud: 21_076 | ||
console: 46_091 | ||
core: 692_106 | ||
crossClusterReplication: 65_408 | ||
dashboard: 374_194 | ||
dashboardEnhanced: 65_646 | ||
dashboardMode: 22_716 | ||
data: 1_170_713 | ||
dataEnhanced: 50_420 | ||
devTools: 38_637 | ||
discover: 105_145 | ||
discoverEnhanced: 42_730 | ||
embeddable: 312_874 | ||
embeddableEnhanced: 41_145 | ||
enterpriseSearch: 35_741 | ||
esUiShared: 326_654 | ||
expressions: 224_136 | ||
features: 31_211 | ||
fileUpload: 24_717 | ||
globalSearch: 43_548 | ||
globalSearchBar: 62_888 | ||
globalSearchProviders: 25_554 | ||
graph: 31_504 | ||
grokdebugger: 26_779 | ||
home: 41_661 | ||
indexLifecycleManagement: 107_090 | ||
indexManagement: 140_608 | ||
indexPatternManagement: 154_222 | ||
infra: 197_873 | ||
ingestManager: 415_829 | ||
ingestPipelines: 58_003 | ||
inputControlVis: 172_675 | ||
inspector: 148_711 | ||
kibanaLegacy: 107_711 | ||
kibanaOverview: 56_279 | ||
kibanaReact: 161_921 | ||
kibanaUtils: 198_829 | ||
lens: 96_624 | ||
licenseManagement: 41_817 | ||
licensing: 39_008 | ||
lists: 183_665 | ||
logstash: 53_548 | ||
management: 46_112 | ||
maps: 183_610 | ||
mapsLegacy: 116_817 | ||
mapsLegacyLicensing: 20_214 | ||
ml: 82_187 | ||
monitoring: 268_612 | ||
navigation: 37_269 | ||
newsfeed: 42_228 | ||
observability: 89_709 | ||
painlessLab: 179_748 | ||
regionMap: 66_098 | ||
remoteClusters: 51_327 | ||
reporting: 183_418 | ||
rollup: 97_204 | ||
savedObjects: 108_518 | ||
savedObjectsManagement: 100_503 | ||
searchprofiler: 67_080 | ||
security: 189_428 | ||
securityOss: 30_806 | ||
securitySolution: 622_387 | ||
share: 99_061 | ||
snapshotRestore: 79_032 | ||
spaces: 387_915 | ||
telemetry: 91_832 | ||
telemetryManagementSection: 52_443 | ||
tileMap: 65_337 | ||
timelion: 29_920 | ||
transform: 41_007 | ||
triggersActionsUi: 170_001 | ||
uiActions: 97_717 | ||
uiActionsEnhanced: 349_511 | ||
upgradeAssistant: 81_241 | ||
uptime: 40_825 | ||
urlDrilldown: 34_174 | ||
urlForwarding: 32_579 | ||
usageCollection: 39_762 | ||
visDefaultEditor: 50_178 | ||
visTypeMarkdown: 30_896 | ||
visTypeMetric: 42_790 | ||
visTypeTable: 94_934 | ||
visTypeTagcloud: 37_575 | ||
visTypeTimelion: 51_933 | ||
visTypeTimeseries: 155_203 | ||
visTypeVega: 153_573 | ||
visTypeVislib: 242_838 | ||
visTypeXy: 20_255 | ||
visualizations: 295_025 | ||
visualize: 57_431 | ||
watcher: 43_598 |
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
1 change: 1 addition & 0 deletions
1
packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import Fs from 'fs'; | ||
|
||
import dedent from 'dedent'; | ||
import Yaml from 'js-yaml'; | ||
import { createFailError, ToolingLog } from '@kbn/dev-utils'; | ||
|
||
import { OptimizerConfig, getMetrics } from './optimizer'; | ||
|
||
const LIMITS_PATH = require.resolve('../limits.yml'); | ||
const DEFAULT_BUDGET = 15000; | ||
|
||
const diff = <T>(a: T[], b: T[]): T[] => a.filter((item) => !b.includes(item)); | ||
|
||
export function readLimits() { | ||
return Yaml.safeLoad(Fs.readFileSync(LIMITS_PATH, 'utf8')); | ||
} | ||
|
||
export function validateLimitsForAllBundles(log: ToolingLog, config: OptimizerConfig) { | ||
const limitBundleIds = Object.keys(config.limits.pageLoadAssetSize); | ||
const configBundleIds = config.bundles.map((b) => b.id); | ||
|
||
const missingBundleIds = diff(configBundleIds, limitBundleIds); | ||
const extraBundleIds = diff(limitBundleIds, configBundleIds); | ||
|
||
const issues = []; | ||
if (missingBundleIds.length) { | ||
issues.push(`missing: ${missingBundleIds.join(', ')}`); | ||
} | ||
if (extraBundleIds.length) { | ||
issues.push(`extra: ${extraBundleIds.join(', ')}`); | ||
} | ||
if (issues.length) { | ||
throw createFailError( | ||
dedent` | ||
The limits defined in packages/kbn-optimizer/limits.yml are outdated. Please update | ||
this file with a limit (in bytes) for every production bundle. | ||
${issues.join('\n ')} | ||
To validate your changes locally, run: | ||
node scripts/build_kibana_platform_plugins.js --validate-limits | ||
` + '\n' | ||
); | ||
} | ||
|
||
log.success('limits.yml file valid'); | ||
} | ||
|
||
export function updateBundleLimits(log: ToolingLog, config: OptimizerConfig) { | ||
const metrics = getMetrics(log, config); | ||
|
||
const number = (input: number) => input.toLocaleString('en').split(',').join('_'); | ||
|
||
let yaml = `pageLoadAssetSize:\n`; | ||
for (const metric of metrics.sort((a, b) => a.id.localeCompare(b.id))) { | ||
if (metric.group === 'page load bundle size') { | ||
yaml += ` ${metric.id}: ${number(metric.value + DEFAULT_BUDGET)}\n`; | ||
} | ||
} | ||
|
||
Fs.writeFileSync(LIMITS_PATH, yaml); | ||
log.success(`wrote updated limits to ${LIMITS_PATH}`); | ||
} |
Oops, something went wrong.