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

Change subject: Update schema to 5832704
......................................................................


Update schema to 5832704

The version of NavigationTiming that is currently deployed computes a set of
Navigation Timing intervals that represent a small subset of the intervals that
are potentially interesting to us. A more flexible approach is to simply
log the value of each interesting marker relative to NavigationStart, and
derive interval measurements on the server.

This patch updates NavigationTiming to revision 5832704 of
<https://meta.wikimedia.org/wiki/Schema:NavigationTiming>. The data points that
are collected reflect my experiments with the Navigation Timing API, documented
at <https://wikitech.wikimedia.org/wiki/Navigation_Timing>.

Change-Id: Ib43387e72ea309f547d5cd4fc52f24cead0e6305
---
M NavigationTiming.php
M modules/ext.navigationTiming.js
2 files changed, 21 insertions(+), 12 deletions(-)

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



diff --git a/NavigationTiming.php b/NavigationTiming.php
index 9064c8f..4822349 100644
--- a/NavigationTiming.php
+++ b/NavigationTiming.php
@@ -35,7 +35,7 @@
        'schema.NavigationTiming' => array(
                'class'         => 'ResourceLoaderSchemaModule',
                'schema'        => 'NavigationTiming',
-               'revision'      => 5336845,
+               'revision'      => 5832704,
                'targets'       => array( 'desktop', 'mobile' ),
                'mobileTargets' => array( 'stable', 'beta', 'alpha' ),
        ),
diff --git a/modules/ext.navigationTiming.js b/modules/ext.navigationTiming.js
index 873a42a..7c57e6c 100644
--- a/modules/ext.navigationTiming.js
+++ b/modules/ext.navigationTiming.js
@@ -65,20 +65,29 @@
                        event.originCountry = Geo.country;
                }
 
-               $.each( {
-                       dnsLookup  : timing.domainLookupEnd - 
timing.domainLookupStart,
-                       connecting : timing.connectEnd - timing.connectStart,
-                       sending    : timing.fetchStart - navStart,
-                       waiting    : timing.responseStart - timing.requestStart,
-                       receiving  : timing.responseEnd - timing.responseStart,
-                       rendering  : timing.loadEventEnd - timing.responseEnd,
-                       loading    : timing.loadEventStart - navStart
-               }, function ( k, v ) {
-                       if ( $.isNumeric( v ) && v > 0 ) {
-                               event[ k ] = v;
+               // Note: This assumes if a browser is good enough to support 
window.performance it supports forEach
+               [
+                       'connectEnd',
+                       'connectStart',
+                       'domComplete',
+                       'domInteractive',
+                       'fetchStart',
+                       'loadEventEnd',
+                       'loadEventStart',
+                       'requestStart',
+                       'responseEnd',
+                       'responseStart'
+               ].forEach( function ( marker ) {
+                       var measure = timing[marker] - navStart;
+                       if ( $.isNumeric( measure ) && measure > 0 ) {
+                               event[ marker ] = measure;
                        }
                } );
 
+               if ( timing.domainLookupStart ) {
+                       event.dnsLookup = timing.domainLookupEnd - 
timing.domainLookupStart;
+               }
+
                if ( timing.redirectStart ) {
                        event.redirectCount = 
performance.navigation.redirectCount;
                        event.redirecting = timing.redirectEnd - 
timing.redirectStart;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib43387e72ea309f547d5cd4fc52f24cead0e6305
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/NavigationTiming
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to