MediaWiki  REL1_24
TransactionProfiler Class Reference

Helper class that detects high-contention DB queries via profiling calls. More...

List of all members.

Public Member Functions

 recordFunctionCompletion ($method, $realtime)
 Register the name and time of a method for slow DB trx detection.
 transactionWritingIn ($server, $db, $id)
 Mark a DB as in a transaction with one or more writes pending.
 transactionWritingOut ($server, $db, $id)
 Mark a DB as no longer in a transaction.

Protected Attributes

float $mDBLockThreshold = 3.0
 Seconds *.
 $mDBTrxHoldingLocks = array()
 $mDBTrxMethodTimes = array()

Detailed Description

Helper class that detects high-contention DB queries via profiling calls.

This class is meant to work with a Profiler, as the later already knows when methods start and finish (which may take place during transactions).

Since:
1.24

Definition at line 372 of file Profiler.php.


Member Function Documentation

TransactionProfiler::recordFunctionCompletion ( method,
realtime 
)

Register the name and time of a method for slow DB trx detection.

This method is only to be called by the Profiler class as methods finish

Parameters:
string$methodFunction name
float$realtimeWal time ellapsed

Definition at line 410 of file Profiler.php.

TransactionProfiler::transactionWritingIn ( server,
db,
id 
)

Mark a DB as in a transaction with one or more writes pending.

Note that there can be multiple connections to a single DB.

Parameters:
string$serverDB server
string$dbDB name
string$idID string of transaction

Definition at line 388 of file Profiler.php.

TransactionProfiler::transactionWritingOut ( server,
db,
id 
)

Mark a DB as no longer in a transaction.

This will check if locks are possibly held for longer than needed and log any affected transactions to a special DB log. Note that there can be multiple connections to a single DB.

Parameters:
string$serverDB server
string$dbDB name
string$idID string of transaction

Definition at line 439 of file Profiler.php.


Member Data Documentation

float TransactionProfiler::$mDBLockThreshold = 3.0 [protected]

Seconds *.

Definition at line 373 of file Profiler.php.

TransactionProfiler::$mDBTrxHoldingLocks = array() [protected]

Definition at line 375 of file Profiler.php.

TransactionProfiler::$mDBTrxMethodTimes = array() [protected]

Definition at line 377 of file Profiler.php.


The documentation for this class was generated from the following file: