Chad has uploaded a new change for review.

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

Change subject: Begin namespacing profiler code
......................................................................

Begin namespacing profiler code

TransactionProfiler is pretty narrowly used, do it first

Change-Id: I156891445ce42efe87e677363870d6b5134d2b28
---
M autoload.php
M includes/db/Database.php
M includes/objectcache/SqlBagOStuff.php
M includes/profiler/Profiler.php
M includes/profiler/TransactionProfiler.php
5 files changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/205992/1

diff --git a/autoload.php b/autoload.php
index ddd8254..8e6e1d3 100644
--- a/autoload.php
+++ b/autoload.php
@@ -760,6 +760,7 @@
        'MediaWiki\\Logger\\Monolog\\WikiProcessor' => __DIR__ . 
'/includes/debug/logger/monolog/WikiProcessor.php',
        'MediaWiki\\Logger\\NullSpi' => __DIR__ . 
'/includes/debug/logger/NullSpi.php',
        'MediaWiki\\Logger\\Spi' => __DIR__ . '/includes/debug/logger/Spi.php',
+       'MediaWiki\\Profiler\\TransactionProfiler' => __DIR__ . 
'/includes/profiler/TransactionProfiler.php',
        'MemCachedClientforWiki' => __DIR__ . 
'/includes/objectcache/MemcachedClient.php',
        'MemcLockManager' => __DIR__ . 
'/includes/filebackend/lockmanager/MemcLockManager.php',
        'MemcachedBagOStuff' => __DIR__ . 
'/includes/objectcache/MemcachedBagOStuff.php',
@@ -1235,7 +1236,6 @@
        'TitleValue' => __DIR__ . '/includes/title/TitleValue.php',
        'TrackBlobs' => __DIR__ . '/maintenance/storage/trackBlobs.php',
        'TraditionalImageGallery' => __DIR__ . 
'/includes/gallery/TraditionalImageGallery.php',
-       'TransactionProfiler' => __DIR__ . 
'/includes/profiler/TransactionProfiler.php',
        'TransformParameterError' => __DIR__ . 
'/includes/media/MediaTransformOutput.php',
        'TransformTooBigImageAreaError' => __DIR__ . 
'/includes/media/MediaTransformOutput.php',
        'TransformationalImageHandler' => __DIR__ . 
'/includes/media/TransformationalImageHandler.php',
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 0bef28a..4fb137f 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -153,7 +153,7 @@
         */
        protected $allViews = null;
 
-       /** @var TransactionProfiler */
+       /** @var MediaWiki\Profiler\TransactionProfiler */
        protected $trxProfiler;
 
        /**
@@ -349,7 +349,7 @@
        }
 
        /**
-        * @return TransactionProfiler
+        * @return MediaWiki\Profiler\TransactionProfiler
         */
        protected function getTransactionProfiler() {
                return $this->trxProfiler
diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index 82eeb84..4006826 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -21,6 +21,8 @@
  * @ingroup Cache
  */
 
+use MediaWiki\Profiler\TransactionProfiler;
+
 /**
  * Class to store objects in the database
  *
diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php
index dbf80fa..935bd47 100644
--- a/includes/profiler/Profiler.php
+++ b/includes/profiler/Profiler.php
@@ -22,6 +22,8 @@
  * @defgroup Profiler Profiler
  */
 
+use MediaWiki\Profiler\TransactionProfiler;
+
 /**
  * Profiler base class that defines the interface and some trivial
  * functionality
@@ -37,7 +39,7 @@
        protected $params = array();
        /** @var IContextSource Current request context */
        protected $context = null;
-       /** @var TransactionProfiler */
+       /** @var MediaWiki\Profiler\TransactionProfiler */
        protected $trxProfiler;
        /** @var Profiler */
        private static $instance = null;
@@ -166,7 +168,7 @@
        }
 
        /**
-        * @return TransactionProfiler
+        * @return MediaWiki\Profiler\TransactionProfiler
         * @since 1.25
         */
        public function getTransactionProfiler() {
diff --git a/includes/profiler/TransactionProfiler.php 
b/includes/profiler/TransactionProfiler.php
index f02d66f..65f8081 100644
--- a/includes/profiler/TransactionProfiler.php
+++ b/includes/profiler/TransactionProfiler.php
@@ -22,9 +22,11 @@
  * @author Aaron Schulz
  */
 
+namespace MediaWiki\Profiler;
 use Psr\Log\LoggerInterface;
 use Psr\Log\LoggerAwareInterface;
 use Psr\Log\NullLogger;
+
 /**
  * Helper class that detects high-contention DB queries via profiling calls
  *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I156891445ce42efe87e677363870d6b5134d2b28
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>

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

Reply via email to