MediaWiki
REL1_22
|
An interface for database load monitoring. More...
Public Member Functions | |
__construct ($parent) | |
Construct a new LoadMonitor with a given LoadBalancer parent. | |
getLagTimes ($serverIndexes, $wiki) | |
Return an estimate of replication lag for each server. | |
postConnectionBackoff ($conn, $threshold) | |
Perform post-connection backoff. | |
scaleLoads (&$loads, $group=false, $wiki=false) | |
Perform pre-connection load ratio adjustment. |
An interface for database load monitoring.
Definition at line 29 of file LoadMonitor.php.
LoadMonitor::__construct | ( | $ | parent | ) |
Construct a new LoadMonitor with a given LoadBalancer parent.
LoadBalancer | $parent |
Implemented in LoadMonitor_MySQL, and LoadMonitor_Null.
LoadMonitor::getLagTimes | ( | $ | serverIndexes, |
$ | wiki | ||
) |
Return an estimate of replication lag for each server.
$serverIndexes | |
$wiki |
Implemented in LoadMonitor_MySQL, and LoadMonitor_Null.
LoadMonitor::postConnectionBackoff | ( | $ | conn, |
$ | threshold | ||
) |
Perform post-connection backoff.
If the connection is in overload, this should return a backoff factor which will be used to control polling time. The number of threads connected is a good measure.
If there is no overload, zero can be returned.
A threshold thread count is given, the concrete class may compare this to the running thread count. The threshold may be false, which indicates that the sysadmin has not configured this feature.
$conn | DatabaseBase |
$threshold | Float |
Implemented in LoadMonitor_MySQL, and LoadMonitor_Null.
LoadMonitor::scaleLoads | ( | &$ | loads, |
$ | group = false , |
||
$ | wiki = false |
||
) |
Perform pre-connection load ratio adjustment.
$loads | array | |
string | $group | the selected query group |
$wiki | String |
Implemented in LoadMonitor_MySQL, and LoadMonitor_Null.