jenkins-bot has submitted this change and it was merged.

Change subject: Add timing data for the first transaction
......................................................................


Add timing data for the first transaction

This doesn't quite tell us about the user's first interaction with
VE (if they open a dialog, for instance, it could be minutes before
that results in a transaction), but it's a good start.

Bug: T76524
Change-Id: I6bac987332802d7363ed65a471b2b1ece67086d8
---
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 9a6bc96..b617c98 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -424,6 +424,7 @@
  * @method
  */
 ve.init.mw.ViewPageTarget.prototype.onSurfaceReady = function () {
+       var surfaceReadyTime = ve.now();
        if ( !this.activating ) {
                // Activation was aborted before we got here. Do nothing
                // TODO are there things we need to clean up?
@@ -440,6 +441,11 @@
                this.surface.mwTocWidget = new ve.ui.MWTocWidget( this.surface 
);
        }
 
+       // 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
        this.transformPageTitle();
        this.changeDocumentTitle();

-- 
To view, visit https://gerrit.wikimedia.org/r/179025
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6bac987332802d7363ed65a471b2b1ece67086d8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to