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

Change subject: Profiling
......................................................................


Profiling

Change-Id: I58ddea12fdae08102435874cc0ad6aba3108dd66
---
M includes/CarrierConfigStore.php
M includes/ConfigPageHooks.php
M includes/PageRenderingHooks.php
M includes/ZeroConfigContent.php
4 files changed, 25 insertions(+), 4 deletions(-)

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



diff --git a/includes/CarrierConfigStore.php b/includes/CarrierConfigStore.php
index 1512135..ebbc627 100644
--- a/includes/CarrierConfigStore.php
+++ b/includes/CarrierConfigStore.php
@@ -151,7 +151,10 @@
                if ( $uri === false ) {
                        return false;
                }
-               return $this->http->get( $uri, self::LOCK_TIMEOUT * 0.8 );
+               wfProfileIn( __METHOD__ );
+               $res = $this->http->get( $uri, self::LOCK_TIMEOUT * 0.8 );
+               wfProfileOut( __METHOD__ );
+               return $res;
        }
 
 
diff --git a/includes/ConfigPageHooks.php b/includes/ConfigPageHooks.php
index 3808c55..ba93198 100644
--- a/includes/ConfigPageHooks.php
+++ b/includes/ConfigPageHooks.php
@@ -60,6 +60,7 @@
        static function onEditFilterMerged( $editor, $text, &$error,
                                                                                
/** @noinspection PhpUnusedParameterInspection */
                                                                                
$summary ) {
+               wfProfileIn( __METHOD__ );
                if ( $editor->getTitle()->inNamespace( NS_ZERO ) ) {
                        $config = new CarrierConfig( $text );
                        if ( $config->isError() ) {
@@ -71,6 +72,7 @@
                                $error = $err;
                        }
                }
+               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php
index ad6c97e..b391239 100644
--- a/includes/PageRenderingHooks.php
+++ b/includes/PageRenderingHooks.php
@@ -389,6 +389,8 @@
         * @return bool|String
         */
        private static function getBannerText( $config, $lang, $sitename ) {
+               wfProfileIn( __METHOD__ );
+
                if ( $lang === null ) {
                        global $wgLang;
                        $lang = $wgLang;
@@ -396,6 +398,7 @@
                $fallbacks = null;
                $name = self::pickLocalizedString( $config['name'], $lang, 
$fallbacks );
                if ( $name === false ) {
+                       wfProfileOut( __METHOD__ );
                        return false;
                }
                $nameMsg = new RawMessage( $name );
@@ -408,7 +411,10 @@
                        $linkText = str_replace( '{{SITENAME}}', $sitename, 
$linkText );
                }
                $linkTextMsg = new RawMessage( $linkText );
-               return $linkTextMsg->inLanguage( $lang )->rawParams( 
$nameMsg->inLanguage( $lang )->escaped() )->escaped();
+               $res = $linkTextMsg->inLanguage( $lang )->rawParams( 
$nameMsg->inLanguage( $lang )->escaped() )->escaped();
+
+               wfProfileOut( __METHOD__ );
+               return $res;
        }
 
 
diff --git a/includes/ZeroConfigContent.php b/includes/ZeroConfigContent.php
index d998d92..6081c4f 100644
--- a/includes/ZeroConfigContent.php
+++ b/includes/ZeroConfigContent.php
@@ -72,6 +72,8 @@
         * @return string: HTML.
         */
        private function objectTable( $config, $isTop = true ) {
+               wfProfileIn( __METHOD__ );
+
                $rows = array();
                $tdAttributes = array( 'class' => 'value' );
 
@@ -110,13 +112,18 @@
                        }
                        $rows[] = Xml::tags( 'tr', $attribs, $th . $td );
                }
-               return Xml::tags( 'table', array( 'class' => 'mw-zero-config' ),
+               $res = Xml::tags( 'table', array( 'class' => 'mw-zero-config' ),
                        Xml::tags( 'tbody', array(), join( "\n", $rows ) )
                );
+
+               wfProfileOut( __METHOD__ );
+               return $res;
        }
 
        private function renderBanners( $conf ) {
                global $wgConf;
+
+               wfProfileIn( __METHOD__ );
                $wgConf->loadFullData();
 
                // Merging keys preserves the order - first all the banners, 
then - name, etc
@@ -136,8 +143,11 @@
                                PageRenderingHooks::renderBanner( $conf, $lang, 
$sitename ) );
                        $rows[] = Xml::tags( 'tr', null, $th . $td );
                }
-               return Xml::tags( 'table', array( 'class' => 
'mw-zero-config-banners' ),
+               $res = Xml::tags( 'table', array( 'class' => 
'mw-zero-config-banners' ),
                        Xml::tags( 'tbody', array(), join( "\n", $rows ) )
                );
+
+               wfProfileOut( __METHOD__ );
+               return $res;
        }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I58ddea12fdae08102435874cc0ad6aba3108dd66
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to