-
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 'implement/restrict-theme-options' of github.com:spalger…
…/kibana into implement/restrict-theme-options
- Loading branch information
Showing
18 changed files
with
106 additions
and
210 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
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
170 changes: 0 additions & 170 deletions
170
docs/management/ingest-pipelines/ingest-pipelines.asciidoc
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { concatMap } from 'rxjs/operators'; | ||
import { CiStatsReporter, ToolingLog } from '@kbn/dev-utils'; | ||
|
||
import { OptimizerConfig } from './optimizer'; | ||
import { OptimizerUpdate$ } from './run_optimizer'; | ||
import { pipeClosure } from './common'; | ||
|
||
export function reportOptimizerTimings(log: ToolingLog, config: OptimizerConfig) { | ||
return pipeClosure((update$: OptimizerUpdate$) => { | ||
let sent = false; | ||
|
||
const cachedBundles = new Set<string>(); | ||
const notCachedBundles = new Set<string>(); | ||
|
||
return update$.pipe( | ||
concatMap(async (update) => { | ||
// if we've already sent timing data then move on | ||
if (sent) { | ||
return update; | ||
} | ||
|
||
if (update.event?.type === 'bundle cached') { | ||
cachedBundles.add(update.event.bundle.id); | ||
} | ||
if (update.event?.type === 'bundle not cached') { | ||
notCachedBundles.add(update.event.bundle.id); | ||
} | ||
|
||
// wait for the optimizer to complete, either with a success or failure | ||
if (update.state.phase !== 'issue' && update.state.phase !== 'success') { | ||
return update; | ||
} | ||
|
||
sent = true; | ||
const reporter = CiStatsReporter.fromEnv(log); | ||
const time = Date.now() - update.state.startTime; | ||
|
||
await reporter.timings({ | ||
timings: [ | ||
{ | ||
group: '@kbn/optimizer', | ||
id: 'overall time', | ||
ms: time, | ||
meta: { | ||
optimizerBundleCount: config.bundles.length, | ||
optimizerBundleCacheCount: cachedBundles.size, | ||
optimizerBundleCachePct: Math.floor( | ||
(cachedBundles.size / config.bundles.length) * 100 | ||
), | ||
optimizerWatch: config.watch, | ||
optimizerProduction: config.dist, | ||
optimizerProfileWebpack: config.profileWebpack, | ||
optimizerBundleThemeTagsCount: config.themeTags.length, | ||
optimizerCache: config.cache, | ||
optimizerMaxWorkerCount: config.maxWorkerCount, | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
return update; | ||
}) | ||
); | ||
}); | ||
} |
Oops, something went wrong.