-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 template-btn
- Loading branch information
Showing
241 changed files
with
5,244 additions
and
1,266 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 |
---|---|---|
@@ -1 +1 @@ | ||
10.19.0 | ||
10.21.0 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
10.19.0 | ||
10.21.0 |
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
39 changes: 39 additions & 0 deletions
39
...evelopment/plugins/data/public/kibana-plugin-plugins-data-public.ui_settings.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,39 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [UI\_SETTINGS](./kibana-plugin-plugins-data-public.ui_settings.md) | ||
|
||
## UI\_SETTINGS variable | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
UI_SETTINGS: { | ||
META_FIELDS: string; | ||
DOC_HIGHLIGHT: string; | ||
QUERY_STRING_OPTIONS: string; | ||
QUERY_ALLOW_LEADING_WILDCARDS: string; | ||
SEARCH_QUERY_LANGUAGE: string; | ||
SORT_OPTIONS: string; | ||
COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: string; | ||
COURIER_SET_REQUEST_PREFERENCE: string; | ||
COURIER_CUSTOM_REQUEST_PREFERENCE: string; | ||
COURIER_MAX_CONCURRENT_SHARD_REQUESTS: string; | ||
COURIER_BATCH_SEARCHES: string; | ||
SEARCH_INCLUDE_FROZEN: string; | ||
HISTOGRAM_BAR_TARGET: string; | ||
HISTOGRAM_MAX_BARS: string; | ||
HISTORY_LIMIT: string; | ||
SHORT_DOTS_ENABLE: string; | ||
FORMAT_DEFAULT_TYPE_MAP: string; | ||
FORMAT_NUMBER_DEFAULT_PATTERN: string; | ||
FORMAT_PERCENT_DEFAULT_PATTERN: string; | ||
FORMAT_BYTES_DEFAULT_PATTERN: string; | ||
FORMAT_CURRENCY_DEFAULT_PATTERN: string; | ||
FORMAT_NUMBER_DEFAULT_LOCALE: string; | ||
TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: string; | ||
TIMEPICKER_QUICK_RANGES: string; | ||
INDEXPATTERN_PLACEHOLDER: string; | ||
FILTERS_PINNED_BY_DEFAULT: string; | ||
FILTERS_EDITOR_SUGGEST_VALUES: string; | ||
} | ||
``` |
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
39 changes: 39 additions & 0 deletions
39
...evelopment/plugins/data/server/kibana-plugin-plugins-data-server.ui_settings.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,39 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [UI\_SETTINGS](./kibana-plugin-plugins-data-server.ui_settings.md) | ||
|
||
## UI\_SETTINGS variable | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
UI_SETTINGS: { | ||
META_FIELDS: string; | ||
DOC_HIGHLIGHT: string; | ||
QUERY_STRING_OPTIONS: string; | ||
QUERY_ALLOW_LEADING_WILDCARDS: string; | ||
SEARCH_QUERY_LANGUAGE: string; | ||
SORT_OPTIONS: string; | ||
COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: string; | ||
COURIER_SET_REQUEST_PREFERENCE: string; | ||
COURIER_CUSTOM_REQUEST_PREFERENCE: string; | ||
COURIER_MAX_CONCURRENT_SHARD_REQUESTS: string; | ||
COURIER_BATCH_SEARCHES: string; | ||
SEARCH_INCLUDE_FROZEN: string; | ||
HISTOGRAM_BAR_TARGET: string; | ||
HISTOGRAM_MAX_BARS: string; | ||
HISTORY_LIMIT: string; | ||
SHORT_DOTS_ENABLE: string; | ||
FORMAT_DEFAULT_TYPE_MAP: string; | ||
FORMAT_NUMBER_DEFAULT_PATTERN: string; | ||
FORMAT_PERCENT_DEFAULT_PATTERN: string; | ||
FORMAT_BYTES_DEFAULT_PATTERN: string; | ||
FORMAT_CURRENCY_DEFAULT_PATTERN: string; | ||
FORMAT_NUMBER_DEFAULT_LOCALE: string; | ||
TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: string; | ||
TIMEPICKER_QUICK_RANGES: string; | ||
INDEXPATTERN_PLACEHOLDER: string; | ||
FILTERS_PINNED_BY_DEFAULT: string; | ||
FILTERS_EDITOR_SUGGEST_VALUES: string; | ||
} | ||
``` |
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 |
---|---|---|
|
@@ -504,7 +504,7 @@ | |
"zlib": "^1.0.5" | ||
}, | ||
"engines": { | ||
"node": "10.19.0", | ||
"node": "10.21.0", | ||
"yarn": "^1.21.1" | ||
} | ||
} |
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
81 changes: 81 additions & 0 deletions
81
packages/kbn-test/src/page_load_metrics/capture_page_load_metrics.ts
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,81 @@ | ||
/* | ||
* 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 { ToolingLog } from '@kbn/dev-utils'; | ||
import { NavigationOptions, createUrl, navigateToApps } from './navigation'; | ||
|
||
export async function capturePageLoadMetrics(log: ToolingLog, options: NavigationOptions) { | ||
const responsesByPageView = await navigateToApps(log, options); | ||
|
||
const assetSizeMeasurements = new Map<string, number[]>(); | ||
|
||
const numberOfPagesVisited = responsesByPageView.size; | ||
|
||
for (const [, frameResponses] of responsesByPageView) { | ||
for (const [, { url, dataLength }] of frameResponses) { | ||
if (url.length === 0) { | ||
throw new Error('navigateToApps(); failed to identify the url of the request'); | ||
} | ||
if (assetSizeMeasurements.has(url)) { | ||
assetSizeMeasurements.set(url, [dataLength].concat(assetSizeMeasurements.get(url) || [])); | ||
} else { | ||
assetSizeMeasurements.set(url, [dataLength]); | ||
} | ||
} | ||
} | ||
|
||
return Array.from(assetSizeMeasurements.entries()) | ||
.map(([url, measurements]) => { | ||
const baseUrl = createUrl('/', options.appConfig.url); | ||
const relativeUrl = url | ||
// remove the baseUrl (expect the trailing slash) to make url relative | ||
.replace(baseUrl.slice(0, -1), '') | ||
// strip the build number from asset urls | ||
.replace(/^\/\d+\//, '/'); | ||
return [relativeUrl, measurements] as const; | ||
}) | ||
.filter(([url, measurements]) => { | ||
if (measurements.length !== numberOfPagesVisited) { | ||
// ignore urls seen only on some pages | ||
return false; | ||
} | ||
|
||
if (url.startsWith('data:')) { | ||
// ignore data urls since they are already counted by other assets | ||
return false; | ||
} | ||
|
||
if (url.startsWith('/api/') || url.startsWith('/internal/')) { | ||
// ignore api requests since they don't have deterministic sizes | ||
return false; | ||
} | ||
|
||
const allMetricsAreEqual = measurements.every((x, i) => | ||
i === 0 ? true : x === measurements[i - 1] | ||
); | ||
if (!allMetricsAreEqual) { | ||
throw new Error(`measurements for url [${url}] are not equal [${measurements.join(',')}]`); | ||
} | ||
|
||
return true; | ||
}) | ||
.map(([url, measurements]) => { | ||
return { group: 'page load asset size', id: url, value: measurements[0] }; | ||
}); | ||
} |
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,90 @@ | ||
/* | ||
* 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 Url from 'url'; | ||
|
||
import { run, createFlagError } from '@kbn/dev-utils'; | ||
import { resolve, basename } from 'path'; | ||
import { capturePageLoadMetrics } from './capture_page_load_metrics'; | ||
|
||
const defaultScreenshotsDir = resolve(__dirname, 'screenshots'); | ||
|
||
export function runPageLoadMetricsCli() { | ||
run( | ||
async ({ flags, log }) => { | ||
const kibanaUrl = flags['kibana-url']; | ||
if (!kibanaUrl || typeof kibanaUrl !== 'string') { | ||
throw createFlagError('Expect --kibana-url to be a string'); | ||
} | ||
|
||
const parsedUrl = Url.parse(kibanaUrl); | ||
|
||
const [username, password] = parsedUrl.auth | ||
? parsedUrl.auth.split(':') | ||
: [flags.username, flags.password]; | ||
|
||
if (typeof username !== 'string' || typeof password !== 'string') { | ||
throw createFlagError( | ||
'Mising username and/or password, either specify in --kibana-url or pass --username and --password' | ||
); | ||
} | ||
|
||
const headless = !flags.head; | ||
|
||
const screenshotsDir = flags.screenshotsDir || defaultScreenshotsDir; | ||
|
||
if (typeof screenshotsDir !== 'string' || screenshotsDir === basename(screenshotsDir)) { | ||
throw createFlagError('Expect screenshotsDir to be valid path string'); | ||
} | ||
|
||
const metrics = await capturePageLoadMetrics(log, { | ||
headless, | ||
appConfig: { | ||
url: kibanaUrl, | ||
username, | ||
password, | ||
}, | ||
screenshotsDir, | ||
}); | ||
for (const metric of metrics) { | ||
log.info(`${metric.id}: ${metric.value}`); | ||
} | ||
}, | ||
{ | ||
description: `Loads several pages with Puppeteer to capture the size of assets`, | ||
flags: { | ||
string: ['kibana-url', 'username', 'password', 'screenshotsDir'], | ||
boolean: ['head'], | ||
default: { | ||
username: 'elastic', | ||
password: 'changeme', | ||
debug: true, | ||
screenshotsDir: defaultScreenshotsDir, | ||
}, | ||
help: ` | ||
--kibana-url Url for Kibana we should connect to, can include login info | ||
--head Run puppeteer with graphical user interface | ||
--username Set username, defaults to 'elastic' | ||
--password Set password, defaults to 'changeme' | ||
--screenshotsDir Set screenshots directory, defaults to '${defaultScreenshotsDir}' | ||
`, | ||
}, | ||
} | ||
); | ||
} |
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,34 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export interface ResponseReceivedEvent { | ||
frameId: string; | ||
loaderId: string; | ||
requestId: string; | ||
response: Record<string, any>; | ||
timestamp: number; | ||
type: string; | ||
} | ||
|
||
export interface DataReceivedEvent { | ||
encodedDataLength: number; | ||
dataLength: number; | ||
requestId: string; | ||
timestamp: number; | ||
} |
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,21 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './cli'; | ||
export { capturePageLoadMetrics } from './capture_page_load_metrics'; |
Oops, something went wrong.