MediaWiki
REL1_24
|
Helper class that detects high-contention DB queries via profiling calls. More...
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() |
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).
Definition at line 372 of file Profiler.php.
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
string | $method | Function name |
float | $realtime | Wal 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.
string | $server | DB server |
string | $db | DB name |
string | $id | ID 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.
string | $server | DB server |
string | $db | DB name |
string | $id | ID string of transaction |
Definition at line 439 of file Profiler.php.
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.