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

ticks - add raw/csv data to startup perf action

上级 a17e37bf
......@@ -29,8 +29,8 @@ define([], function () {
function Tick(name, started, stopped, profile) {
this.name = name;
this.started = started;
this.stopped = stopped;
this.started = Math.round((started[0] * 1e9 + started[1]) / 1e6);
this.stopped = Math.round((stopped[0] * 1e9 + stopped[1]) / 1e6);
this.duration = Math.round(((stopped[0] * 1.e9 + stopped[1]) - (started[0] * 1e9 + started[1])) / 1.e6);
this.profile = profile;
}
......@@ -86,7 +86,7 @@ define([], function () {
function ticks() {
var ret = [];
_ticks.forEach(function (value) { ret.push(value); });
return ret;
return ret.sort((a, b) => a.started - b.started);
}
function tick(name) {
......
......@@ -45,6 +45,7 @@ import { IWorkspaceIdentifier, getWorkspaceLabel, ISingleFolderWorkspaceIdentifi
import { FileKind } from 'vs/platform/files/common/files';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import { ticks } from 'vs/base/node/startupTimers';
// --- actions
......@@ -363,6 +364,15 @@ export class ShowStartupPerformance extends Action {
(<any>console).group('Extension Activation Stats');
(<any>console).table(this.extensionService.getExtensionsActivationTimes());
(<any>console).groupEnd();
(<any>console).group('Raw Startup Timers (CSV)');
let value = `Name\tStart\tDuration\n`;
let offset = ticks()[0].started;
for (const tick of ticks()) {
value += `${tick.name}\t${tick.started - offset}\t${tick.duration}\n`;
}
console.log(value);
(<any>console).groupEnd();
}, 1000);
return TPromise.as(true);
......@@ -1622,4 +1632,4 @@ export class ToggleWindowTabsBar extends Action {
public run(): TPromise<boolean> {
return this.windowsService.toggleWindowTabsBar().then(() => true);
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册