EBernhardson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378744 )

Change subject: Log javascript errors during search satisfaction tests
......................................................................

Log javascript errors during search satisfaction tests

We have some unexplained problems with data collection recently:
* The interleaved AB test didn't send the trigger key with all expected
  searches
* Sampling rates combined with recorded sessions are off by about 5x
  from what we might expect based on backend logging.

Perhaps these are due to javascript errors occuring in the browser
that we can't see. Log them to get some insight.

Change-Id: Ibd7c9aa9eaa6c15c3a0cd5c9305eebcc30103c4f
---
M extension.json
M modules/ext.wikimediaEvents.searchSatisfaction.js
2 files changed, 24 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/44/378744/1

diff --git a/extension.json b/extension.json
index cbc7db6..cac3d20 100644
--- a/extension.json
+++ b/extension.json
@@ -127,6 +127,11 @@
                        "schema": "TestSearchSatisfaction2",
                        "revision": 16909631
                },
+               "schema.SearchSatisfactionErrors": {
+                       "class": "ResourceLoaderSchemaModule",
+                       "schema": "SearchSatisfactionErrors",
+                       "revision": 17181648
+               },
                "schema.GeoFeatures": {
                        "class": "ResourceLoaderSchemaModule",
                        "schema": "GeoFeatures",
diff --git a/modules/ext.wikimediaEvents.searchSatisfaction.js 
b/modules/ext.wikimediaEvents.searchSatisfaction.js
index 9e52636..4b194bc 100644
--- a/modules/ext.wikimediaEvents.searchSatisfaction.js
+++ b/modules/ext.wikimediaEvents.searchSatisfaction.js
@@ -25,7 +25,7 @@
                return;
        }
 
-       var search, autoComplete, session, eventLog, initSubTest,
+       var search, autoComplete, session, eventLog, initSubTest, 
initDebugLogging,
                isSearchResultPage = mw.config.get( 'wgIsSearchResultPage' ),
                uri = new mw.Uri( location.href ),
                checkinTimes = [ 10, 20, 30, 40, 50, 60, 90, 120, 150, 180, 
210, 240, 300, 360, 420 ],
@@ -970,6 +970,23 @@
                }
        } );
 
+       initDebugLogging = atMostOnce( function ( session ) {
+               mw.trackSubscribe( 'global.error', function ( topic, data ) {
+                       var evt = {
+                               searchSessionId: session.get( 'sessionId' ),
+                               visitPageId: session.get( 'pageViewId' ),
+                               message: data.errorMessage,
+                               error: data.errorObject.toString()
+                       };
+
+                       // ship the event
+                       mw.loader.using( [ 'schema.SearchSatisfactionErrors' ] 
).then( function () {
+                               eventLog = eventLog || extendMwEventLog();
+                               eventLog.logEvent( 'TestSearchSatisfaction2', 
evt );
+                       } );
+               } );
+       } );
+
        /**
         * Delay session initialization as late in the
         * process as possible, but only do it once.
@@ -980,6 +997,7 @@
                session = session || new SessionState();
 
                if ( session.isActive() ) {
+                       initDebugLogging( session );
                        initSubTest( session );
                        fn( session );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd7c9aa9eaa6c15c3a0cd5c9305eebcc30103c4f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

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

Reply via email to