[client-app] Measure and record times for opening account windows

Summary: See title

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4017
This commit is contained in:
Juan Tejada 2017-02-22 10:59:51 -08:00
parent ecf3709669
commit feda238d9c
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import React from 'react';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import {Actions} from 'nylas-exports'
import OnboardingStore from './onboarding-store';
import PageTopBar from './page-top-bar';
@ -41,6 +42,13 @@ export default class OnboardingRoot extends React.Component {
this.unsubscribe = OnboardingStore.listen(this._onStateChanged, this);
NylasEnv.center();
NylasEnv.displayWindow();
if (NylasEnv.timer.isPending('open-add-account-window')) {
Actions.recordPerfMetric({
action: 'open-add-account-window',
actionTimeMs: NylasEnv.timer.stop('open-add-account-window'),
maxValue: 4000,
})
}
}
componentWillUnmount() {

View file

@ -301,6 +301,7 @@ export default class Application extends EventEmitter {
});
this.on('application:add-account', ({existingAccount, accountType} = {}) => {
this.timer.start('open-add-account-window')
const onboarding = this.windowManager.get(WindowManager.ONBOARDING_WINDOW);
if (onboarding) {
if (onboarding.browserWindow.webContents) {