MediaWiki
master
|
Basic MySQL load monitor with no external dependencies Uses memcached to cache the replication lag for a short time. More...
Public Member Functions | |
__construct ($parent) | |
Construct a new LoadMonitor with a given LoadBalancer parent. More... | |
clearCaches () | |
Clear any process and persistent cache of lag times. More... | |
getLagTimes ($serverIndexes, $wiki) | |
Get an estimate of replication lag (in seconds) for each server. More... | |
scaleLoads (&$loads, $group=false, $wiki=false) | |
Perform pre-connection load ratio adjustment. More... | |
Public Attributes | |
LoadBalancer | $parent |
Protected Attributes | |
BagOStuff | $mainCache |
BagOStuff | $srvCache |
Private Member Functions | |
getLagTimeCacheKey () | |
Basic MySQL load monitor with no external dependencies Uses memcached to cache the replication lag for a short time.
Definition at line 28 of file LoadMonitorMySQL.php.
LoadMonitorMySQL::__construct | ( | $parent | ) |
Construct a new LoadMonitor with a given LoadBalancer parent.
LoadBalancer | $parent |
Implements LoadMonitor.
Definition at line 36 of file LoadMonitorMySQL.php.
References $parent, ObjectCache\getLocalClusterInstance(), and ObjectCache\getLocalServerInstance().
LoadMonitorMySQL::clearCaches | ( | ) |
Clear any process and persistent cache of lag times.
Implements LoadMonitor.
Definition at line 135 of file LoadMonitorMySQL.php.
References getLagTimeCacheKey().
|
private |
Definition at line 141 of file LoadMonitorMySQL.php.
Referenced by clearCaches(), and getLagTimes().
LoadMonitorMySQL::getLagTimes | ( | $serverIndexes, | |
$wiki | |||
) |
Get an estimate of replication lag (in seconds) for each server.
Values may be "false" if replication is too broken to estimate
array | $serverIndexes | |
string | $wiki |
Implements LoadMonitor.
Definition at line 46 of file LoadMonitorMySQL.php.
References $cache, $mainCache, $value, as, getLagTimeCacheKey(), use, and wfDebugLog().
Perform pre-connection load ratio adjustment.
array | &$loads | |
string | bool | $group | The selected query group. Default: false |
string | bool | $wiki | Default: false |
Implements LoadMonitor.
Definition at line 43 of file LoadMonitorMySQL.php.
|
protected |
Definition at line 34 of file LoadMonitorMySQL.php.
Referenced by getLagTimes().
LoadBalancer LoadMonitorMySQL::$parent |
Definition at line 30 of file LoadMonitorMySQL.php.
Referenced by __construct().
|
protected |
Definition at line 32 of file LoadMonitorMySQL.php.