Merge from vscode 1b314ab317fbff7d799b21754326b7d849889ceb

This commit is contained in:
ADS Merger
2020-07-15 23:51:18 +00:00
parent aae013d498
commit 9d3f12d0b7
554 changed files with 15159 additions and 8223 deletions

View File

@@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { localize } from 'vs/nls';
import { registerAction2, Action2 } from 'vs/platform/actions/common/actions';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Registry } from 'vs/platform/registry/common/platform';
import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
import { Extensions as Input, IEditorInputFactory, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor';
import { PerfviewContrib, PerfviewInput } from 'vs/workbench/contrib/performance/browser/perfviewEditor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
// -- startup performance view
Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench).registerWorkbenchContribution(
PerfviewContrib,
LifecyclePhase.Ready
);
Registry.as<IEditorInputFactoryRegistry>(Input.EditorInputFactories).registerEditorInputFactory(
PerfviewInput.Id,
class implements IEditorInputFactory {
canSerialize(): boolean {
return true;
}
serialize(): string {
return '';
}
deserialize(instantiationService: IInstantiationService): PerfviewInput {
return instantiationService.createInstance(PerfviewInput);
}
}
);
registerAction2(class extends Action2 {
constructor() {
super({
id: 'perfview.show',
title: { value: localize('show.label', "Startup Performance"), original: 'Startup Performance' },
category: { value: localize({ key: 'show.cat', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"), original: 'Developer' },
f1: true
});
}
run(accessor: ServicesAccessor) {
const editorService = accessor.get(IEditorService);
const instaService = accessor.get(IInstantiationService);
return editorService.openEditor(instaService.createInstance(PerfviewInput));
}
});

View File

@@ -12,7 +12,7 @@ import { ILifecycleService, LifecyclePhase, StartupKindToString } from 'vs/platf
import { IModeService } from 'vs/editor/common/services/modeService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IModelService } from 'vs/editor/common/services/modelService';
import { ITimerService, IStartupMetrics } from 'vs/workbench/services/timer/electron-browser/timerService';
import { ITimerService, IStartupMetrics } from 'vs/workbench/services/timer/browser/timerService';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import * as perf from 'vs/base/common/performance';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
@@ -179,6 +179,7 @@ class PerfModelContentProvider implements ITextModelContentProvider {
table.push(['restore editors', metrics.timers.ellapsedEditorRestore, '[renderer]', `${metrics.editorIds.length}: ${metrics.editorIds.join(', ')}`]);
table.push(['overall workbench load', metrics.timers.ellapsedWorkbench, '[renderer]', undefined]);
table.push(['workbench ready', metrics.ellapsed, '[main->renderer]', undefined]);
table.push(['renderer ready', metrics.timers.ellapsedRenderer, '[renderer]', undefined]);
table.push(['extensions registered', metrics.timers.ellapsedExtensionsReady, '[renderer]', undefined]);
md.heading(2, 'Performance Marks');
@@ -421,6 +422,5 @@ class MarkdownBuilder {
});
this.value += '|\n';
});
}
}

View File

@@ -3,54 +3,12 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { localize } from 'vs/nls';
import { MenuRegistry } from 'vs/platform/actions/common/actions';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { Registry } from 'vs/platform/registry/common/platform';
import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
import { Extensions as Input, IEditorInputFactory, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor';
import { PerfviewContrib, PerfviewInput } from 'vs/workbench/contrib/performance/electron-browser/perfviewEditor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { StartupProfiler } from './startupProfiler';
import { StartupTimings } from './startupTimings';
// -- startup performance view
Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench).registerWorkbenchContribution(
PerfviewContrib,
LifecyclePhase.Ready
);
Registry.as<IEditorInputFactoryRegistry>(Input.EditorInputFactories).registerEditorInputFactory(
PerfviewInput.Id,
class implements IEditorInputFactory {
canSerialize(): boolean {
return true;
}
serialize(): string {
return '';
}
deserialize(instantiationService: IInstantiationService): PerfviewInput {
return instantiationService.createInstance(PerfviewInput);
}
}
);
CommandsRegistry.registerCommand('perfview.show', accessor => {
const editorService = accessor.get(IEditorService);
const instaService = accessor.get(IInstantiationService);
return editorService.openEditor(instaService.createInstance(PerfviewInput));
});
MenuRegistry.addCommand({
id: 'perfview.show',
category: localize({ key: 'show.cat', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"),
title: localize('show.label', "Startup Performance")
});
// -- startup profiler
Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench).registerWorkbenchContribution(

View File

@@ -12,7 +12,7 @@ import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/enviro
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { PerfviewInput } from 'vs/workbench/contrib/performance/electron-browser/perfviewEditor';
import { PerfviewInput } from 'vs/workbench/contrib/performance/browser/perfviewEditor';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { URI } from 'vs/base/common/uri';

View File

@@ -19,9 +19,9 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import * as files from 'vs/workbench/contrib/files/common/files';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { didUseCachedData, ITimerService } from 'vs/workbench/services/timer/electron-browser/timerService';
import { didUseCachedData } from 'vs/workbench/services/timer/electron-browser/timerService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { getEntries } from 'vs/base/common/performance';
import { ITimerService } from 'vs/workbench/services/timer/browser/timerService';
export class StartupTimings implements IWorkbenchContribution {
@@ -43,22 +43,7 @@ export class StartupTimings implements IWorkbenchContribution {
private async _report() {
const standardStartupError = await this._isStandardStartup();
this._reportStartupTimes().catch(onUnexpectedError);
this._appendStartupTimes(standardStartupError).catch(onUnexpectedError);
this._reportPerfTicks();
}
private async _reportStartupTimes(): Promise<void> {
const metrics = await this._timerService.startupMetrics;
/* __GDPR__
"startupTimeVaried" : {
"${include}": [
"${IStartupMetrics}"
]
}
*/
this._telemetryService.publicLog('startupTimeVaried', metrics);
}
private async _appendStartupTimes(standardStartupError: string | undefined) {
@@ -120,17 +105,4 @@ export class StartupTimings implements IWorkbenchContribution {
}
return undefined;
}
private _reportPerfTicks(): void {
const entries: Record<string, number> = Object.create(null);
for (const entry of getEntries()) {
entries[entry.name] = entry.startTime;
}
/* __GDPR__
"startupRawTimers" : {
"entries": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
}
*/
this._telemetryService.publicLog('startupRawTimers', { entries });
}
}