提交 eb1fbf0e 编写于 作者: J Johannes Rieken

add `ellapsedPanelRestore` to perf metrics, #56253

上级 02d7e668
...@@ -730,12 +730,10 @@ export class Workbench extends Disposable implements IPartService { ...@@ -730,12 +730,10 @@ export class Workbench extends Disposable implements IPartService {
const panelRegistry = Registry.as<PanelRegistry>(PanelExtensions.Panels); const panelRegistry = Registry.as<PanelRegistry>(PanelExtensions.Panels);
const panelId = this.storageService.get(PanelPart.activePanelSettingsKey, StorageScope.WORKSPACE, panelRegistry.getDefaultPanelId()); const panelId = this.storageService.get(PanelPart.activePanelSettingsKey, StorageScope.WORKSPACE, panelRegistry.getDefaultPanelId());
if (!this.panelHidden && !!panelId) { if (!this.panelHidden && !!panelId) {
perf.mark('willRestorePanel');
const isPanelToRestoreEnabled = !!this.panelPart.getPanels().filter(p => p.id === panelId).length; const isPanelToRestoreEnabled = !!this.panelPart.getPanels().filter(p => p.id === panelId).length;
if (isPanelToRestoreEnabled) { const panelIdToRestore = isPanelToRestoreEnabled ? panelId : panelRegistry.getDefaultPanelId();
restorePromises.push(this.panelPart.openPanel(panelId, false)); restorePromises.push(this.panelPart.openPanel(panelIdToRestore, false).then(() => perf.mark('didRestorePanel')));
} else {
restorePromises.push(this.panelPart.openPanel(panelRegistry.getDefaultPanelId(), false));
}
} }
// Restore Zen Mode if active // Restore Zen Mode if active
......
...@@ -55,6 +55,7 @@ export interface IMemoryInfo { ...@@ -55,6 +55,7 @@ export interface IMemoryInfo {
"timers.ellapsedExtensionsReady" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedExtensionsReady" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedRequire" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedRequire" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedViewletRestore" : { "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 }, "timers.ellapsedEditorRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedWorkbench" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedWorkbench" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
"timers.ellapsedTimersToTimersComputed" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedTimersToTimersComputed" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
...@@ -231,6 +232,16 @@ export interface IStartupMetrics { ...@@ -231,6 +232,16 @@ export interface IStartupMetrics {
*/ */
ellapsedViewletRestore: number; ellapsedViewletRestore: number;
/**
* The time it took to restore the panel.
*
* * Happens in the renderer-process
* * Measured with the `willRestorePanel` and `didRestorePanel` performance marks.
* * This should be looked at per panel-type/id.
* * Happens in parallel to other things, depends on async timing
*/
ellapsedPanelRestore: number;
/** /**
* The time it took to restore editors - that is text editor and complex editor likes the settings UI * The time it took to restore editors - that is text editor and complex editor likes the settings UI
* or webviews (markdown preview). * or webviews (markdown preview).
...@@ -355,6 +366,7 @@ class TimerService implements ITimerService { ...@@ -355,6 +366,7 @@ class TimerService implements ITimerService {
ellapsedExtensions: perf.getDuration('willLoadExtensions', 'didLoadExtensions'), ellapsedExtensions: perf.getDuration('willLoadExtensions', 'didLoadExtensions'),
ellapsedEditorRestore: perf.getDuration('willRestoreEditors', 'didRestoreEditors'), ellapsedEditorRestore: perf.getDuration('willRestoreEditors', 'didRestoreEditors'),
ellapsedViewletRestore: perf.getDuration('willRestoreViewlet', 'didRestoreViewlet'), ellapsedViewletRestore: perf.getDuration('willRestoreViewlet', 'didRestoreViewlet'),
ellapsedPanelRestore: perf.getDuration('willRestorePanel', 'didRestorePanel'),
ellapsedWorkbench: perf.getDuration('willStartWorkbench', 'didStartWorkbench'), ellapsedWorkbench: perf.getDuration('willStartWorkbench', 'didStartWorkbench'),
ellapsedExtensionsReady: perf.getDuration(startMark, 'didLoadExtensions'), ellapsedExtensionsReady: perf.getDuration(startMark, 'didLoadExtensions'),
ellapsedTimersToTimersComputed: Date.now() - now, ellapsedTimersToTimersComputed: Date.now() - now,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册