提交 65d85057 编写于 作者: B Benjamin Pasero

Telemetry: We should log startup times (fixes #707)

上级 e2341f63
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/* global __filename, __dirname, global, process */ /* global __filename, __dirname, global, process */
// Perf measurements // Perf measurements
global.vscodeStart = new Date().getTime(); global.vscodeStart = Date.now();
var app = require('app'); var app = require('app');
var path = require('path'); var path = require('path');
......
...@@ -244,9 +244,6 @@ function setupIPC(): TPromise<Server> { ...@@ -244,9 +244,6 @@ function setupIPC(): TPromise<Server> {
return setup(true); return setup(true);
} }
function setupMutex() {
}
// On some platforms we need to manually read from the global environment variables // On some platforms we need to manually read from the global environment variables
// and assign them to the process environment (e.g. when doubleclick app on Mac) // and assign them to the process environment (e.g. when doubleclick app on Mac)
getUserEnvironment() getUserEnvironment()
...@@ -255,7 +252,6 @@ getUserEnvironment() ...@@ -255,7 +252,6 @@ getUserEnvironment()
return timebomb() return timebomb()
.then(setupIPC) .then(setupIPC)
.then(ipcServer => { setupMutex(); return ipcServer; })
.then(ipcServer => main(ipcServer, userEnv)); .then(ipcServer => main(ipcServer, userEnv));
}) })
.done(null, quit); .done(null, quit);
\ No newline at end of file
...@@ -302,6 +302,17 @@ export class WindowsManager { ...@@ -302,6 +302,17 @@ export class WindowsManager {
app.on('will-quit', () => { app.on('will-quit', () => {
storage.setItem(WindowsManager.windowsStateStorageKey, this.windowsState); storage.setItem(WindowsManager.windowsStateStorageKey, this.windowsState);
}); });
let loggedStartupTimes = false;
onReady(window => {
if (loggedStartupTimes) {
return; // only for the first window
}
loggedStartupTimes = true;
window.send('vscode:telemetry', { eventName: 'startupTime', data: { ellapsed: Date.now() - global.vscodeStart } });
});
} }
public reload(win: window.VSCodeWindow, cli?: env.ICommandLineArguments): void { public reload(win: window.VSCodeWindow, cli?: env.ICommandLineArguments): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册