提交 0ca70f86 编写于 作者: J Johannes Rieken

tweak perf data

上级 78490f85
......@@ -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';
......
......@@ -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());
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册