Merge "Add timing data for the first transaction"

This commit is contained in:
jenkins-bot 2014-12-11 03:06:14 +00:00 committed by Gerrit Code Review
commit eacb364ed1

View file

@ -424,6 +424,7 @@ ve.init.mw.ViewPageTarget.prototype.onLoadError = function ( jqXHR, status ) {
* @method * @method
*/ */
ve.init.mw.ViewPageTarget.prototype.onSurfaceReady = function () { ve.init.mw.ViewPageTarget.prototype.onSurfaceReady = function () {
var surfaceReadyTime = ve.now();
if ( !this.activating ) { if ( !this.activating ) {
// Activation was aborted before we got here. Do nothing // Activation was aborted before we got here. Do nothing
// TODO are there things we need to clean up? // TODO are there things we need to clean up?
@ -439,6 +440,11 @@ ve.init.mw.ViewPageTarget.prototype.onSurfaceReady = function () {
this.getSurface().mwTocWidget = new ve.ui.MWTocWidget( this.getSurface() ); this.getSurface().mwTocWidget = new ve.ui.MWTocWidget( this.getSurface() );
} }
// Track how long it takes for the first transaction to happen
this.surface.getModel().getDocument().once( 'transact', function () {
ve.track( 'mwtiming.behavior.firstTransaction', { duration: ve.now() - surfaceReadyTime } );
} );
// Update UI // Update UI
this.transformPageTitle(); this.transformPageTitle();
this.changeDocumentTitle(); this.changeDocumentTitle();