LoadMonitor_MySQL Class Reference

Basic MySQL load monitor with no external dependencies Uses memcached to cache the replication lag for a short time. More...

Inherits LoadMonitor.

List of all members.

Public Member Functions

 __construct ($parent)
 Construct a new LoadMonitor with a given LoadBalancer parent.
 scaleLoads (&$loads, $group=false, $wiki=false)
 Perform pre-connection load ratio adjustment.
 getLagTimes ($serverIndexes, $wiki)
 Return an estimate of replication lag for each server.
 postConnectionBackoff ($conn, $threshold)
 Perform post-connection backoff.

Public Attributes

 $parent


Detailed Description

Basic MySQL load monitor with no external dependencies Uses memcached to cache the replication lag for a short time.

Definition at line 51 of file LoadMonitor.php.


Constructor & Destructor Documentation

LoadMonitor_MySQL::__construct ( parent  ) 

Construct a new LoadMonitor with a given LoadBalancer parent.

Implements LoadMonitor.

Definition at line 54 of file LoadMonitor.php.

References $parent.


Member Function Documentation

LoadMonitor_MySQL::getLagTimes ( serverIndexes,
wiki 
)

Return an estimate of replication lag for each server.

Implements LoadMonitor.

Definition at line 61 of file LoadMonitor.php.

References $i, $wgMemc, wfGetMainCache(), wfIncrStats(), wfMemcKey(), wfProfileIn(), and wfProfileOut().

LoadMonitor_MySQL::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.

Parameters:
Database $conn
float $threshold

Implements LoadMonitor.

Definition at line 112 of file LoadMonitor.php.

References $status.

LoadMonitor_MySQL::scaleLoads ( &$  loads,
group = false,
wiki = false 
)

Perform pre-connection load ratio adjustment.

Parameters:
array $loads
string $group The selected query group
string $wiki

Implements LoadMonitor.

Definition at line 58 of file LoadMonitor.php.


Member Data Documentation

LoadMonitor_MySQL::$parent

Definition at line 52 of file LoadMonitor.php.

Referenced by __construct().


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

Generated on Sat Sep 5 02:08:41 2009 for MediaWiki by  doxygen 1.5.9