Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 (#14050)

* Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79

* Fix breaks

* Extension management fixes

* Fix breaks in windows bundling

* Fix/skip failing tests

* Update distro

* Add clear to nuget.config

* Add hygiene task

* Bump distro

* Fix hygiene issue

* Add build to hygiene exclusion

* Update distro

* Update hygiene

* Hygiene exclusions

* Update tsconfig

* Bump distro for server breaks

* Update build config

* Update darwin path

* Add done calls to notebook tests

* Skip failing tests

* Disable smoke tests
This commit is contained in:
Karl Burtram
2021-02-09 16:15:05 -08:00
committed by GitHub
parent 6f192f9af5
commit ce612a3d96
1929 changed files with 68012 additions and 34564 deletions

View File

@@ -8,7 +8,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IUpdateService } from 'vs/platform/update/common/update';
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
@@ -47,6 +47,8 @@ export interface IMemoryInfo {
"timers.ellapsedRequire" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedWorkspaceStorageInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedWorkspaceServiceInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedRequiredUserDataInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedOtherUserDataInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedViewletRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedPanelRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedEditorRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
@@ -98,7 +100,7 @@ export interface IStartupMetrics {
readonly didUseCachedData: boolean;
/**
* How/why the window was created. See https://github.com/Microsoft/vscode/blob/d1f57d871722f4d6ba63e4ef6f06287121ceb045/src/vs/platform/lifecycle/common/lifecycle.ts#L50
* How/why the window was created. See https://github.com/microsoft/vscode/blob/d1f57d871722f4d6ba63e4ef6f06287121ceb045/src/vs/platform/lifecycle/common/lifecycle.ts#L50
*/
readonly windowKind: number;
@@ -186,6 +188,15 @@ export interface IStartupMetrics {
*/
readonly ellapsedWindowLoadToRequire: number;
/**
* The time it took to wait for resolving the shell environment. This time the workbench
* will not continue to load and be blocked entirely.
*
* * Happens in the renderer-process
* * Measured with the `willWaitForShellEnv` and `didWaitForShellEnv` performance marks.
*/
readonly ellapsedWaitForShellEnv: number;
/**
* The time it took to require the workspace storage DB, connect to it
* and load the initial set of values.
@@ -203,6 +214,22 @@ export interface IStartupMetrics {
*/
readonly ellapsedWorkspaceServiceInit: number;
/**
* The time it took to initialize required user data (settings & global state) using settings sync service.
*
* * Happens in the renderer-process (only in Web)
* * Measured with the `willInitRequiredUserData` and `didInitRequiredUserData` performance marks.
*/
readonly ellapsedRequiredUserDataInit: number;
/**
* The time it took to initialize other user data (keybindings, snippets & extensions) using settings sync service.
*
* * Happens in the renderer-process (only in Web)
* * Measured with the `willInitOtherUserData` and `didInitOtherUserData` performance marks.
*/
readonly ellapsedOtherUserDataInit: number;
/**
* The time it took to load the main-bundle of the workbench, e.g. `workbench.desktop.main.js`.
*
@@ -307,7 +334,7 @@ export abstract class AbstractTimerService implements ITimerService {
declare readonly _serviceBrand: undefined;
private _startupMetrics?: Promise<IStartupMetrics>;
private readonly _startupMetrics: Promise<IStartupMetrics>;
constructor(
@ILifecycleService private readonly _lifecycleService: ILifecycleService,
@@ -319,17 +346,19 @@ export abstract class AbstractTimerService implements ITimerService {
@IEditorService private readonly _editorService: IEditorService,
@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,
@ITelemetryService private readonly _telemetryService: ITelemetryService,
) { }
) {
this._startupMetrics = Promise.all([
this._extensionService.whenInstalledExtensionsRegistered(),
_lifecycleService.when(LifecyclePhase.Restored)
])
.then(() => this._computeStartupMetrics())
.then(metrics => {
this._reportStartupTimes(metrics);
return metrics;
});
}
get startupMetrics(): Promise<IStartupMetrics> {
if (!this._startupMetrics) {
this._startupMetrics = this._extensionService.whenInstalledExtensionsRegistered()
.then(() => this._computeStartupMetrics())
.then(metrics => {
this._reportStartupTimes(metrics);
return metrics;
});
}
return this._startupMetrics;
}
@@ -386,8 +415,11 @@ export abstract class AbstractTimerService implements ITimerService {
ellapsedWindowLoad: initialStartup ? perf.getDuration('main:appReady', 'main:loadWindow') : undefined,
ellapsedWindowLoadToRequire: perf.getDuration('main:loadWindow', 'willLoadWorkbenchMain'),
ellapsedRequire: perf.getDuration('willLoadWorkbenchMain', 'didLoadWorkbenchMain'),
ellapsedWaitForShellEnv: perf.getDuration('willWaitForShellEnv', 'didWaitForShellEnv'),
ellapsedWorkspaceStorageInit: perf.getDuration('willInitWorkspaceStorage', 'didInitWorkspaceStorage'),
ellapsedWorkspaceServiceInit: perf.getDuration('willInitWorkspaceService', 'didInitWorkspaceService'),
ellapsedRequiredUserDataInit: perf.getDuration('willInitRequiredUserData', 'didInitRequiredUserData'),
ellapsedOtherUserDataInit: perf.getDuration('willInitOtherUserData', 'didInitOtherUserData'),
ellapsedExtensions: perf.getDuration('willLoadExtensions', 'didLoadExtensions'),
ellapsedEditorRestore: perf.getDuration('willRestoreEditors', 'didRestoreEditors'),
ellapsedViewletRestore: perf.getDuration('willRestoreViewlet', 'didRestoreViewlet'),

View File

@@ -3,27 +3,25 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { virtualMachineHint } from 'vs/base/node/id';
import * as os from 'os';
import { IElectronService } from 'vs/platform/electron/electron-sandbox/electron';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IUpdateService } from 'vs/platform/update/common/update';
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
import { IStartupMetrics, AbstractTimerService, Writeable } from 'vs/workbench/services/timer/browser/timerService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { context, process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
export class TimerService extends AbstractTimerService {
constructor(
@IElectronService private readonly _electronService: IElectronService,
@IWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService,
@INativeHostService private readonly _nativeHostService: INativeHostService,
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService,
@ILifecycleService lifecycleService: ILifecycleService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IExtensionService extensionService: IExtensionService,
@@ -44,17 +42,23 @@ export class TimerService extends AbstractTimerService {
return didUseCachedData();
}
protected _getWindowCount(): Promise<number> {
return this._electronService.getWindowCount();
return this._nativeHostService.getWindowCount();
}
protected async _extendStartupInfo(info: Writeable<IStartupMetrics>): Promise<void> {
try {
info.totalmem = os.totalmem();
info.freemem = os.freemem();
info.platform = os.platform();
info.release = os.release();
info.arch = os.arch();
info.loadavg = os.loadavg();
const [osProperties, osStatistics, virtualMachineHint] = await Promise.all([
this._nativeHostService.getOSProperties(),
this._nativeHostService.getOSStatistics(),
this._nativeHostService.getOSVirtualMachineHint()
]);
info.totalmem = osStatistics.totalmem;
info.freemem = osStatistics.freemem;
info.platform = osProperties.platform;
info.release = osProperties.release;
info.arch = osProperties.arch;
info.loadavg = osStatistics.loadavg;
const processMemoryInfo = await process.getProcessMemoryInfo();
info.meminfo = {
@@ -63,9 +67,9 @@ export class TimerService extends AbstractTimerService {
sharedBytes: processMemoryInfo.shared
};
info.isVMLikelyhood = Math.round((virtualMachineHint.value() * 100));
info.isVMLikelyhood = Math.round((virtualMachineHint * 100));
const rawCpus = os.cpus();
const rawCpus = osProperties.cpus;
if (rawCpus && rawCpus.length > 0) {
info.cpus = { count: rawCpus.length, speed: rawCpus[0].speed, model: rawCpus[0].model };
}
@@ -78,8 +82,12 @@ export class TimerService extends AbstractTimerService {
//#region cached data logic
export function didUseCachedData(): boolean {
// TODO@Ben TODO@Jo need a different way to figure out if cached data was used
if (context.sandbox) {
return true;
}
// We surely don't use cached data when we don't tell the loader to do so
if (!Boolean((<any>global).require.getConfig().nodeCachedData)) {
if (!Boolean((<any>window).require.getConfig().nodeCachedData)) {
return false;
}
// There are loader events that signal if cached data was missing, rejected,