Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/95070


Change subject: startup.js: log current time as global 'mediaWikiLoadStart'
......................................................................

startup.js: log current time as global 'mediaWikiLoadStart'

Capturing the current time as early as possible in the process of loading a
page provides a common reference-point for all user latency measurements. The
limitations of this technique are well-known (and are presented as part of the
rationale for the Navigation Timing API, which was designed to obsolete it --
see 
<https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html#introduction>
 --
but it remains the only technique that is implemented across all
JavaScript-capable browsers. Relying on the Navigation Timing API alone
excludes some 30% of browsers in use, including all versions of Mobile Safari.

This patch adds a line to startup.js that stores the current time in a
JavaScript global, mediaWikiLoadStart. I am not glib about introducing
additional globals, but I think the circumstances make it desirable to do the
straightforward thing (i.e., add a global) rather than try to set it as a
config var.

Change-Id: I3d5bcf10ecccb7f65bdbad397cf19a5b8fde7fd9
---
M resources/startup.js
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/70/95070/1

diff --git a/resources/startup.js b/resources/startup.js
index b6a27d2..c6113d4 100644
--- a/resources/startup.js
+++ b/resources/startup.js
@@ -4,6 +4,8 @@
  * even the most ancient of browsers, so be very careful when editing.
  */
 
+var mediaWikiLoadStart = ( new Date() ).getTime();
+
 /**
  * Returns false when run in a black-listed browser
  *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d5bcf10ecccb7f65bdbad397cf19a5b8fde7fd9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

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

Reply via email to