/** @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
*
* @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 );
}
/**
*
* @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 );
}
/**
* 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
* 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
*
* @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 {
*
* @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 ) {
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] );