diff --git a/src/vs/workbench/electron-browser/workbench.main.ts b/src/vs/workbench/electron-browser/workbench.main.ts index 151ceffc7b0d28ed937791ca1b75f9e564b549d1..891f770bbdb8ccd172c87787d435aa67762d5a7d 100644 --- a/src/vs/workbench/electron-browser/workbench.main.ts +++ b/src/vs/workbench/electron-browser/workbench.main.ts @@ -104,7 +104,7 @@ import 'vs/workbench/parts/update/electron-browser/update.contribution'; import 'vs/workbench/parts/nps/electron-browser/nps.contribution'; -import 'vs/workbench/parts/performance/performance.contribution'; +import 'vs/workbench/parts/performance/electron-browser/performance.contribution'; import 'vs/workbench/parts/cli/electron-browser/cli.contribution'; diff --git a/src/vs/workbench/parts/performance/performance.contribution.ts b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts similarity index 81% rename from src/vs/workbench/parts/performance/performance.contribution.ts rename to src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts index 58917262f5235177dbe75f8da27e2ce2809427a8..8b98d26a3e0cdc251f891618584143008f34e8bb 100644 --- a/src/vs/workbench/parts/performance/performance.contribution.ts +++ b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts @@ -6,6 +6,8 @@ 'use strict'; import { assign } from 'vs/base/common/objects'; +import { join } from 'path'; +import { generateUuid } from 'vs/base/common/uuid'; import { TPromise } from 'vs/base/common/winjs.base'; import { Registry } from 'vs/platform/platform'; import { writeFile } from 'vs/base/node/pfs'; @@ -29,7 +31,7 @@ class PerformanceContribution implements IWorkbenchContribution { if (dumpFile) { // wait for extensions being loaded extensionService.onReady() - .then(() => TPromise.timeout(100)) // time service isn't ready yet because it listens on the same event... + .then(() => TPromise.timeout(1000)) // time service isn't ready yet because it listens on the same event... .then(() => this._dumpTimersAndQuit(dumpFile)) .done(undefined, err => console.error(err)); } @@ -39,11 +41,12 @@ class PerformanceContribution implements IWorkbenchContribution { return 'performance'; } - private _dumpTimersAndQuit(path: string) { + private _dumpTimersAndQuit(folder: string) { const metrics = this._timerService.startupMetrics; - const all = assign({ commit: product.commit }, metrics); + const id = generateUuid(); + const all = assign({ id, commit: product.commit }, metrics); const raw = JSON.stringify(all); - return writeFile(path, raw).then(() => this._windowsService.quit()); + return writeFile(join(folder, `${id}.json`), raw).then(() => this._windowsService.quit()); } }