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

send telemetry when invalid timers have been computed

上级 5c940299
......@@ -25,6 +25,7 @@ import { readdir } from 'vs/base/node/pfs';
import { release } from 'os';
import { stopProfiling } from 'vs/base/node/profiler';
import { virtualMachineHint } from 'vs/base/node/id';
import { forEach } from "vs/base/common/collections";
class ProfilingHint implements IWorkbenchContribution {
......@@ -208,6 +209,36 @@ class StartupProfiler implements IWorkbenchContribution {
}
}
class PerformanceTelemetry implements IWorkbenchContribution {
constructor(
@ITimerService private readonly _timerService: ITimerService,
@ITelemetryService private readonly _telemetryService: ITelemetryService,
@IExtensionService extensionService: IExtensionService,
) {
TPromise.join<any>([
TPromise.timeout(7 * 1000),
extensionService.onReady()
]).then(() => this._validateTimers());
}
getId(): string {
return 'performance.PerformanceTelemetry';
}
private _validateTimers(): void {
const { startupMetrics } = this._timerService;
const invalidTimers: string[] = [];
forEach(startupMetrics.timers, (entry) => {
if (entry.value < 0) {
invalidTimers.push(entry.key);
}
});
this._telemetryService.publicLog('invalidTimers', { invalidTimers });
}
}
const registry = Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench);
registry.registerWorkbenchContribution(ProfilingHint);
registry.registerWorkbenchContribution(StartupProfiler);
registry.registerWorkbenchContribution(PerformanceTelemetry);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册