Merge "Several tweaks to the install.php script"
[lhc/web/wiklou.git] / includes / profiler / Profiler.php
index 1581879..f6bafd5 100644 (file)
@@ -101,8 +101,10 @@ abstract class Profiler {
        /** @var TransactionProfiler */
        protected $trxProfiler;
 
-       /** @var Profiler */
-       public static $__instance = null; // do not call this outside Profiler and ProfileSection
+       // @codingStandardsIgnoreStart PSR2.Classes.PropertyDeclaration.Underscore
+       /** @var Profiler Do not call this outside Profiler and ProfileSection */
+       public static $__instance = null;
+       // @codingStandardsIgnoreEnd
 
        /**
         * @param array $params
@@ -205,9 +207,10 @@ abstract class Profiler {
         *
         * @param string $server DB server
         * @param string $db DB name
+        * @param string $id Resource ID string of connection
         */
-       public function transactionWritingIn( $server, $db ) {
-               $this->trxProfiler->transactionWritingIn( $server, $db );
+       public function transactionWritingIn( $server, $db, $id = '' ) {
+               $this->trxProfiler->transactionWritingIn( $server, $db, $id );
        }
 
        /**
@@ -219,9 +222,10 @@ abstract class Profiler {
         *
         * @param string $server DB server
         * @param string $db DB name
+        * @param string $id Resource ID string of connection
         */
-       public function transactionWritingOut( $server, $db ) {
-               $this->trxProfiler->transactionWritingOut( $server, $db );
+       public function transactionWritingOut( $server, $db, $id = '' ) {
+               $this->trxProfiler->transactionWritingOut( $server, $db, $id );
        }
 
        /**
@@ -259,7 +263,7 @@ abstract class Profiler {
         * Get the initial time of the request, based either on $wgRequestTime or
         * $wgRUstart. Will return null if not able to find data.
         *
-        * @param string|false $metric Metric to use, with the following possibilities:
+        * @param string|bool $metric Metric to use, with the following possibilities:
         *   - user: User CPU time (without system calls)
         *   - cpu: Total CPU time (user and system calls)
         *   - wall (or any other string): elapsed time
@@ -288,7 +292,7 @@ abstract class Profiler {
         * Get the initial time of the request, based either on $wgRequestTime or
         * $wgRUstart. Will return null if not able to find data.
         *
-        * @param string|false $metric Metric to use, with the following possibilities:
+        * @param string|bool $metric Metric to use, with the following possibilities:
         *   - user: User CPU time (without system calls)
         *   - cpu: Total CPU time (user and system calls)
         *   - wall (or any other string): elapsed time
@@ -366,9 +370,10 @@ class TransactionProfiler {
         *
         * @param string $server DB server
         * @param string $db DB name
+        * @param string $id Resource ID string of connection
         */
-       public function transactionWritingIn( $server, $db ) {
-               $name = "{$server} ({$db})";
+       public function transactionWritingIn( $server, $db, $id ) {
+               $name = "{$server} ({$db}) ($id)";
                if ( isset( $this->mDBTrxHoldingLocks[$name] ) ) {
                        ++$this->mDBTrxHoldingLocks[$name]['refs'];
                } else {
@@ -412,9 +417,10 @@ class TransactionProfiler {
         *
         * @param string $server DB server
         * @param string $db DB name
+        * @param string $id Resource ID string of connection
         */
-       public function transactionWritingOut( $server, $db ) {
-               $name = "{$server} ({$db})";
+       public function transactionWritingOut( $server, $db, $id ) {
+               $name = "{$server} ({$db}) ($id)";
                if ( --$this->mDBTrxHoldingLocks[$name]['refs'] <= 0 ) {
                        $slow = false;
                        foreach ( $this->mDBTrxMethodTimes[$name] as $info ) {
@@ -431,7 +437,7 @@ class TransactionProfiler {
                                        list( $method, $realtime ) = $info;
                                        $msg .= sprintf( "%d\t%.6f\t%s\n", $i, $realtime, $method );
                                }
-                               $this->debugGroup( 'DBPerformance', $msg );
+                               wfDebugLog( 'DBPerformance', $msg );
                        }
                        unset( $this->mDBTrxHoldingLocks[$name] );
                        unset( $this->mDBTrxMethodTimes[$name] );