AndyRussG has uploaded a new change for review.

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

Change subject: ***Pls don't merge*** Performance marks for benchmarking on labs
......................................................................

***Pls don't merge*** Performance marks for benchmarking on labs

Change-Id: Icb1a0abf84cc02fc405f6880fa1be14a356135f0
---
M resources/subscribing/ext.centralNotice.display.js
1 file changed, 19 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/40/233040/1

diff --git a/resources/subscribing/ext.centralNotice.display.js 
b/resources/subscribing/ext.centralNotice.display.js
index 8b4a929..18e7e01 100644
--- a/resources/subscribing/ext.centralNotice.display.js
+++ b/resources/subscribing/ext.centralNotice.display.js
@@ -27,7 +27,7 @@
  *         Provides cn.internal.hide.
  *
  * For an overview of how this all fits together, see
- * mw.centralNotice.reallyChooseAndMaybeDisplay() (below).
+ * reallyChooseAndMaybeDisplay() (below).
  *
  * We also provide access points for kvStore on mw.centralNotice, even though
  * kvStore is in a different RL module. Campaign mixins that need kvStore 
should
@@ -44,6 +44,14 @@
                bannerLoadedDeferredObj;
 
        // TODO: make data.result options explicit via constants
+
+       if ( !window.performance ) {
+               window.performance = {};
+       }
+       if ( !performance.mark ) {
+               performance.mark = function () {};
+       }
+       performance.mark( 'displayInitialLoad' );
 
        /**
         * Class for campaign-associated mixins. Access via 
mw.centralNotice.Mixin.
@@ -119,6 +127,8 @@
                        url = new mw.Uri(
                                mw.config.get( 
'wgCentralSelectedBannerDispatcher' ) );
 
+               performance.mark( 'fetchBanner' );
+
                url.extend(
                        {
                                campaign: data.campaign,
@@ -179,6 +189,8 @@
                        hide = cn.internal.hide,
                        campaign,
                        banner;
+
+               performance.mark( 'reallyChooseAndMaybeDisplay' );
 
                // This will gather initial data needed for selection and 
display.
                // We expose it above via a getter on the data property.
@@ -320,6 +332,8 @@
                        bannerLoadedButHiddenReason,
                        tmpData;
 
+                       performance.mark( 'reallyInsertBanner' );
+
                        // Inject the banner HTML into the DOM
                        injectBannerHTML( bannerJson.bannerHtml );
 
@@ -439,6 +453,8 @@
                 */
                chooseAndMaybeDisplay: function() {
 
+                       performance.mark( 'chooseAndMaybeDisplay' );
+
                        // Make sure GeoIP info is available before processing
 
                        // geoIP usually doesn't make background requests; 
however, it may
@@ -469,6 +485,8 @@
 
                insertBanner: function( bannerJson ) {
 
+                       performance.mark( 'insertBanner' );
+
                        // Insert the banner only after the DOM is ready
                        $( function() {
                                cn.reallyInsertBanner( bannerJson );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb1a0abf84cc02fc405f6880fa1be14a356135f0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: campaign_mixins
Gerrit-Owner: AndyRussG <[email protected]>

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

Reply via email to