mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-29 16:20:29 -04:00
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:
@@ -6,8 +6,9 @@
|
||||
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 { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { CATEGORIES } from 'vs/workbench/common/actions';
|
||||
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';
|
||||
@@ -42,7 +43,7 @@ registerAction2(class extends Action2 {
|
||||
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' },
|
||||
category: CATEGORIES.Developer,
|
||||
f1: true
|
||||
});
|
||||
}
|
||||
@@ -50,6 +51,6 @@ registerAction2(class extends Action2 {
|
||||
run(accessor: ServicesAccessor) {
|
||||
const editorService = accessor.get(IEditorService);
|
||||
const instaService = accessor.get(IInstantiationService);
|
||||
return editorService.openEditor(instaService.createInstance(PerfviewInput));
|
||||
return editorService.openEditor(instaService.createInstance(PerfviewInput), { pinned: true });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
|
||||
import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { ILifecycleService, LifecyclePhase, StartupKindToString } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ILifecycleService, LifecyclePhase, StartupKindToString } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
@@ -18,14 +18,15 @@ import * as perf from 'vs/base/common/performance';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { writeTransientState } from 'vs/workbench/contrib/codeEditor/browser/toggleWordWrap';
|
||||
import { mergeSort } from 'vs/base/common/arrays';
|
||||
import { LoaderStats } from 'vs/base/common/amd';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { ByteSize, IFileService } from 'vs/platform/files/common/files';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { isWeb } from 'vs/base/common/platform';
|
||||
|
||||
export class PerfviewContrib {
|
||||
|
||||
@@ -150,10 +151,10 @@ class PerfModelContentProvider implements ITextModelContentProvider {
|
||||
md.li(`CPUs: ${metrics.cpus.model}(${metrics.cpus.count} x ${metrics.cpus.speed})`);
|
||||
}
|
||||
if (typeof metrics.totalmem === 'number' && typeof metrics.freemem === 'number') {
|
||||
md.li(`Memory(System): ${(metrics.totalmem / (1024 * 1024 * 1024)).toFixed(2)} GB(${(metrics.freemem / (1024 * 1024 * 1024)).toFixed(2)}GB free)`);
|
||||
md.li(`Memory(System): ${(metrics.totalmem / (ByteSize.GB)).toFixed(2)} GB(${(metrics.freemem / (ByteSize.GB)).toFixed(2)}GB free)`);
|
||||
}
|
||||
if (metrics.meminfo) {
|
||||
md.li(`Memory(Process): ${(metrics.meminfo.workingSetSize / 1024).toFixed(2)} MB working set(${(metrics.meminfo.privateBytes / 1024).toFixed(2)}MB private, ${(metrics.meminfo.sharedBytes / 1024).toFixed(2)}MB shared)`);
|
||||
md.li(`Memory(Process): ${(metrics.meminfo.workingSetSize / ByteSize.KB).toFixed(2)} MB working set(${(metrics.meminfo.privateBytes / ByteSize.KB).toFixed(2)}MB private, ${(metrics.meminfo.sharedBytes / ByteSize.KB).toFixed(2)}MB shared)`);
|
||||
}
|
||||
md.li(`VM(likelyhood): ${metrics.isVMLikelyhood}%`);
|
||||
md.li(`Initial Startup: ${metrics.initialStartup}`);
|
||||
@@ -171,8 +172,13 @@ class PerfModelContentProvider implements ITextModelContentProvider {
|
||||
table.push(['app.isReady => window.loadUrl()', metrics.timers.ellapsedWindowLoad, '[main]', `initial startup: ${metrics.initialStartup}`]);
|
||||
table.push(['window.loadUrl() => begin to require(workbench.desktop.main.js)', metrics.timers.ellapsedWindowLoadToRequire, '[main->renderer]', StartupKindToString(metrics.windowKind)]);
|
||||
table.push(['require(workbench.desktop.main.js)', metrics.timers.ellapsedRequire, '[renderer]', `cached data: ${(metrics.didUseCachedData ? 'YES' : 'NO')}${stats ? `, node_modules took ${stats.nodeRequireTotal}ms` : ''}`]);
|
||||
table.push(['wait for shell environment', metrics.timers.ellapsedWaitForShellEnv, '[renderer]', undefined]);
|
||||
table.push(['require & init workspace storage', metrics.timers.ellapsedWorkspaceStorageInit, '[renderer]', undefined]);
|
||||
table.push(['init workspace service', metrics.timers.ellapsedWorkspaceServiceInit, '[renderer]', undefined]);
|
||||
if (isWeb) {
|
||||
table.push(['init settings and global state from settings sync service', metrics.timers.ellapsedRequiredUserDataInit, '[renderer]', undefined]);
|
||||
table.push(['init keybindings, snippets & extensions from settings sync service', metrics.timers.ellapsedOtherUserDataInit, '[renderer]', undefined]);
|
||||
}
|
||||
table.push(['register extensions & spawn extension host', metrics.timers.ellapsedExtensions, '[renderer]', undefined]);
|
||||
table.push(['restore viewlet', metrics.timers.ellapsedViewletRestore, '[renderer]', metrics.viewletId]);
|
||||
table.push(['restore panel', metrics.timers.ellapsedPanelRestore, '[renderer]', metrics.panelId]);
|
||||
@@ -279,100 +285,6 @@ class PerfModelContentProvider implements ITextModelContentProvider {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class LoaderStats {
|
||||
abstract get amdLoad(): (string | number)[][];
|
||||
abstract get amdInvoke(): (string | number)[][];
|
||||
abstract get nodeRequire(): (string | number)[][];
|
||||
abstract get nodeEval(): (string | number)[][];
|
||||
abstract get nodeRequireTotal(): number;
|
||||
|
||||
|
||||
static get(): LoaderStats {
|
||||
|
||||
|
||||
const amdLoadScript = new Map<string, number>();
|
||||
const amdInvokeFactory = new Map<string, number>();
|
||||
const nodeRequire = new Map<string, number>();
|
||||
const nodeEval = new Map<string, number>();
|
||||
|
||||
function mark(map: Map<string, number>, stat: LoaderEvent) {
|
||||
if (map.has(stat.detail)) {
|
||||
// console.warn('BAD events, DOUBLE start', stat);
|
||||
// map.delete(stat.detail);
|
||||
return;
|
||||
}
|
||||
map.set(stat.detail, -stat.timestamp);
|
||||
}
|
||||
|
||||
function diff(map: Map<string, number>, stat: LoaderEvent) {
|
||||
let duration = map.get(stat.detail);
|
||||
if (!duration) {
|
||||
// console.warn('BAD events, end WITHOUT start', stat);
|
||||
// map.delete(stat.detail);
|
||||
return;
|
||||
}
|
||||
if (duration >= 0) {
|
||||
// console.warn('BAD events, DOUBLE end', stat);
|
||||
// map.delete(stat.detail);
|
||||
return;
|
||||
}
|
||||
map.set(stat.detail, duration + stat.timestamp);
|
||||
}
|
||||
|
||||
const stats = mergeSort(require.getStats().slice(0), (a, b) => a.timestamp - b.timestamp);
|
||||
|
||||
for (const stat of stats) {
|
||||
switch (stat.type) {
|
||||
case LoaderEventType.BeginLoadingScript:
|
||||
mark(amdLoadScript, stat);
|
||||
break;
|
||||
case LoaderEventType.EndLoadingScriptOK:
|
||||
case LoaderEventType.EndLoadingScriptError:
|
||||
diff(amdLoadScript, stat);
|
||||
break;
|
||||
|
||||
case LoaderEventType.BeginInvokeFactory:
|
||||
mark(amdInvokeFactory, stat);
|
||||
break;
|
||||
case LoaderEventType.EndInvokeFactory:
|
||||
diff(amdInvokeFactory, stat);
|
||||
break;
|
||||
|
||||
case LoaderEventType.NodeBeginNativeRequire:
|
||||
mark(nodeRequire, stat);
|
||||
break;
|
||||
case LoaderEventType.NodeEndNativeRequire:
|
||||
diff(nodeRequire, stat);
|
||||
break;
|
||||
|
||||
case LoaderEventType.NodeBeginEvaluatingScript:
|
||||
mark(nodeEval, stat);
|
||||
break;
|
||||
case LoaderEventType.NodeEndEvaluatingScript:
|
||||
diff(nodeEval, stat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let nodeRequireTotal = 0;
|
||||
nodeRequire.forEach(value => nodeRequireTotal += value);
|
||||
|
||||
function to2dArray(map: Map<string, number>): (string | number)[][] {
|
||||
let res: (string | number)[][] = [];
|
||||
map.forEach((value, index) => res.push([index, value]));
|
||||
return res;
|
||||
}
|
||||
|
||||
return {
|
||||
amdLoad: to2dArray(amdLoadScript),
|
||||
amdInvoke: to2dArray(amdInvokeFactory),
|
||||
nodeRequire: to2dArray(nodeRequire),
|
||||
nodeEval: to2dArray(nodeEval),
|
||||
nodeRequireTotal
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class MarkdownBuilder {
|
||||
|
||||
value: string = '';
|
||||
@@ -393,34 +305,6 @@ class MarkdownBuilder {
|
||||
}
|
||||
|
||||
table(header: string[], rows: Array<Array<{ toString(): string } | undefined>>) {
|
||||
let lengths: number[] = [];
|
||||
header.forEach((cell, ci) => {
|
||||
lengths[ci] = cell.length;
|
||||
});
|
||||
rows.forEach(row => {
|
||||
row.forEach((cell, ci) => {
|
||||
if (typeof cell === 'undefined') {
|
||||
cell = row[ci] = '-';
|
||||
}
|
||||
const len = cell.toString().length;
|
||||
lengths[ci] = Math.max(len, lengths[ci]);
|
||||
});
|
||||
});
|
||||
|
||||
// header
|
||||
header.forEach((cell, ci) => { this.value += `| ${cell + ' '.repeat(lengths[ci] - cell.toString().length)} `; });
|
||||
this.value += '|\n';
|
||||
header.forEach((_cell, ci) => { this.value += `| ${'-'.repeat(lengths[ci])} `; });
|
||||
this.value += '|\n';
|
||||
|
||||
// cells
|
||||
rows.forEach(row => {
|
||||
row.forEach((cell, ci) => {
|
||||
if (typeof cell !== 'undefined') {
|
||||
this.value += `| ${cell + ' '.repeat(lengths[ci] - cell.toString().length)} `;
|
||||
}
|
||||
});
|
||||
this.value += '|\n';
|
||||
});
|
||||
this.value += LoaderStats.toMarkdownTable(header, rows);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { StartupProfiler } from './startupProfiler';
|
||||
|
||||
@@ -8,29 +8,28 @@ import { exists, readdir, readFile, rimraf } from 'vs/base/node/pfs';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
|
||||
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
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';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IElectronService } from 'vs/platform/electron/electron-sandbox/electron';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
|
||||
export class StartupProfiler implements IWorkbenchContribution {
|
||||
|
||||
constructor(
|
||||
@IDialogService private readonly _dialogService: IDialogService,
|
||||
@IWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService,
|
||||
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService,
|
||||
@ITextModelService private readonly _textModelResolverService: ITextModelService,
|
||||
@IClipboardService private readonly _clipboardService: IClipboardService,
|
||||
@ILifecycleService lifecycleService: ILifecycleService,
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
@IOpenerService private readonly _openerService: IOpenerService,
|
||||
@IElectronService private readonly _electronService: IElectronService,
|
||||
@INativeHostService private readonly _nativeHostService: INativeHostService,
|
||||
@IProductService private readonly _productService: IProductService
|
||||
) {
|
||||
// wait for everything to be ready
|
||||
@@ -78,12 +77,12 @@ export class StartupProfiler implements IWorkbenchContribution {
|
||||
type: 'info',
|
||||
message: localize('prof.message', "Successfully created profiles."),
|
||||
detail: localize('prof.detail', "Please create an issue and manually attach the following files:\n{0}", profileFiles),
|
||||
primaryButton: localize('prof.restartAndFileIssue', "Create Issue and Restart"),
|
||||
secondaryButton: localize('prof.restart', "Restart")
|
||||
primaryButton: localize('prof.restartAndFileIssue', "&&Create Issue and Restart"),
|
||||
secondaryButton: localize('prof.restart', "&&Restart")
|
||||
}).then(res => {
|
||||
if (res.confirmed) {
|
||||
Promise.all<any>([
|
||||
this._electronService.showItemInFolder(URI.file(join(dir, files[0])).fsPath),
|
||||
this._nativeHostService.showItemInFolder(URI.file(join(dir, files[0])).fsPath),
|
||||
this._createPerfIssue(files)
|
||||
]).then(() => {
|
||||
// keep window stable until restart is selected
|
||||
@@ -91,17 +90,17 @@ export class StartupProfiler implements IWorkbenchContribution {
|
||||
type: 'info',
|
||||
message: localize('prof.thanks', "Thanks for helping us."),
|
||||
detail: localize('prof.detail.restart', "A final restart is required to continue to use '{0}'. Again, thank you for your contribution.", this._productService.nameLong),
|
||||
primaryButton: localize('prof.restart', "Restart"),
|
||||
primaryButton: localize('prof.restart.button', "&&Restart"),
|
||||
secondaryButton: undefined
|
||||
}).then(() => {
|
||||
// now we are ready to restart
|
||||
this._electronService.relaunch({ removeArgs });
|
||||
this._nativeHostService.relaunch({ removeArgs });
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
// simply restart
|
||||
this._electronService.relaunch({ removeArgs });
|
||||
this._nativeHostService.relaunch({ removeArgs });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,18 +8,17 @@ import { timeout } from 'vs/base/common/async';
|
||||
import { promisify } from 'util';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
|
||||
import { ILifecycleService, StartupKind, StartupKindToString } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ILifecycleService, StartupKind, StartupKindToString } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IUpdateService } from 'vs/platform/update/common/update';
|
||||
import { IElectronService } from 'vs/platform/electron/electron-sandbox/electron';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
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 } from 'vs/workbench/services/timer/electron-browser/timerService';
|
||||
import { didUseCachedData } from 'vs/workbench/services/timer/electron-sandbox/timerService';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { ITimerService } from 'vs/workbench/services/timer/browser/timerService';
|
||||
|
||||
@@ -27,14 +26,14 @@ export class StartupTimings implements IWorkbenchContribution {
|
||||
|
||||
constructor(
|
||||
@ITimerService private readonly _timerService: ITimerService,
|
||||
@IElectronService private readonly _electronService: IElectronService,
|
||||
@INativeHostService private readonly _nativeHostService: INativeHostService,
|
||||
@IEditorService private readonly _editorService: IEditorService,
|
||||
@IViewletService private readonly _viewletService: IViewletService,
|
||||
@IPanelService private readonly _panelService: IPanelService,
|
||||
@ITelemetryService private readonly _telemetryService: ITelemetryService,
|
||||
@ILifecycleService private readonly _lifecycleService: ILifecycleService,
|
||||
@IUpdateService private readonly _updateService: IUpdateService,
|
||||
@IWorkbenchEnvironmentService private readonly _envService: INativeWorkbenchEnvironmentService,
|
||||
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService,
|
||||
@IProductService private readonly _productService: IProductService
|
||||
) {
|
||||
//
|
||||
@@ -47,7 +46,7 @@ export class StartupTimings implements IWorkbenchContribution {
|
||||
}
|
||||
|
||||
private async _appendStartupTimes(standardStartupError: string | undefined) {
|
||||
const appendTo = this._envService.args['prof-append-timers'];
|
||||
const appendTo = this._environmentService.args['prof-append-timers'];
|
||||
if (!appendTo) {
|
||||
// nothing to do
|
||||
return;
|
||||
@@ -61,10 +60,10 @@ export class StartupTimings implements IWorkbenchContribution {
|
||||
]).then(([startupMetrics]) => {
|
||||
return promisify(appendFile)(appendTo, `${startupMetrics.ellapsed}\t${this._productService.nameShort}\t${(this._productService.commit || '').slice(0, 10) || '0000000000'}\t${sessionId}\t${standardStartupError === undefined ? 'standard_start' : 'NO_standard_start : ' + standardStartupError}\n`);
|
||||
}).then(() => {
|
||||
this._electronService.quit();
|
||||
this._nativeHostService.quit();
|
||||
}).catch(err => {
|
||||
console.error(err);
|
||||
this._electronService.quit();
|
||||
this._nativeHostService.quit();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -78,7 +77,7 @@ export class StartupTimings implements IWorkbenchContribution {
|
||||
if (this._lifecycleService.startupKind !== StartupKind.NewWindow) {
|
||||
return StartupKindToString(this._lifecycleService.startupKind);
|
||||
}
|
||||
const windowCount = await this._electronService.getWindowCount();
|
||||
const windowCount = await this._nativeHostService.getWindowCount();
|
||||
if (windowCount !== 1) {
|
||||
return 'Expected window count : 1, Actual : ' + windowCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user