From c219c3f73382e57847bcc76f56106dc05d392db6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 13 Dec 2017 11:18:04 +0100 Subject: [PATCH] debt - remove appReady from timerService, use perf-marks --- src/main.js | 1 - src/vs/code/electron-main/window.ts | 1 - src/vs/workbench/electron-browser/bootstrap/index.js | 1 - src/vs/workbench/services/timer/common/timerService.ts | 4 ---- src/vs/workbench/services/timer/node/timerService.ts | 6 ++---- 5 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main.js b/src/main.js index 3192f1f086c..6e29b5203a6 100644 --- a/src/main.js +++ b/src/main.js @@ -219,7 +219,6 @@ var nodeCachedDataDir = getNodeCachedDataDir().then(function (value) { // Load our code once ready app.once('ready', function () { perf.mark('main:appReady'); - global.perfAppReady = Date.now(); var nlsConfig = getNLSConfiguration(); process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig); diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index bdf16efb1f5..4c37dd6e993 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -587,7 +587,6 @@ export class CodeWindow implements ICodeWindow { // Perf Counters windowConfiguration.perfEntries = exportEntries(); windowConfiguration.perfStartTime = global.perfStartTime; - windowConfiguration.perfAppReady = global.perfAppReady; windowConfiguration.perfWindowLoadTime = Date.now(); // Config (combination of process.argv and window configuration) diff --git a/src/vs/workbench/electron-browser/bootstrap/index.js b/src/vs/workbench/electron-browser/bootstrap/index.js index 9357afcaeab..867ed81842e 100644 --- a/src/vs/workbench/electron-browser/bootstrap/index.js +++ b/src/vs/workbench/electron-browser/bootstrap/index.js @@ -175,7 +175,6 @@ function main() { isInitialStartup: !!configuration.isInitialStartup, hasAccessibilitySupport: !!configuration.accessibilitySupport, start: configuration.perfStartTime, - appReady: configuration.perfAppReady, windowLoad: configuration.perfWindowLoadTime }; diff --git a/src/vs/workbench/services/timer/common/timerService.ts b/src/vs/workbench/services/timer/common/timerService.ts index 5b06fc4cdef..f6ca71866cb 100644 --- a/src/vs/workbench/services/timer/common/timerService.ts +++ b/src/vs/workbench/services/timer/common/timerService.ts @@ -83,11 +83,7 @@ export interface IStartupMetrics { export interface IInitData { start: number; - - appReady: number; - windowLoad: number; - isInitialStartup: boolean; hasAccessibilitySupport: boolean; } diff --git a/src/vs/workbench/services/timer/node/timerService.ts b/src/vs/workbench/services/timer/node/timerService.ts index 972dae9b351..7a49b00ba65 100644 --- a/src/vs/workbench/services/timer/node/timerService.ts +++ b/src/vs/workbench/services/timer/node/timerService.ts @@ -14,7 +14,6 @@ export class TimerService implements ITimerService { public _serviceBrand: any; public readonly start: number; - public readonly appReady: number; public readonly windowLoad: number; public readonly isInitialStartup: boolean; @@ -24,7 +23,6 @@ export class TimerService implements ITimerService { constructor(initData: IInitData, private isEmptyWorkbench: boolean) { this.start = initData.start; - this.appReady = initData.appReady; this.windowLoad = initData.windowLoad; this.isInitialStartup = initData.isInitialStartup; @@ -100,8 +98,8 @@ export class TimerService implements ITimerService { }; if (initialStartup) { - this._startupMetrics.timers.ellapsedAppReady = this.appReady - this.start; - this._startupMetrics.timers.ellapsedWindowLoad = this.windowLoad - this.appReady; + this._startupMetrics.timers.ellapsedAppReady = perf.getDuration('main:started', 'main:appReady'); + this._startupMetrics.timers.ellapsedWindowLoad = this.windowLoad - perf.getEntry('mark', 'main:appReady').startTime; } } }