MediaWiki  1.23.2
LoadMonitorMySQL Class Reference

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

Inheritance diagram for LoadMonitorMySQL:
Collaboration diagram for LoadMonitorMySQL:

Public Member Functions

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

Public Attributes

LoadBalancer $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 74 of file LoadMonitor.php.

Constructor & Destructor Documentation

◆ __construct()

LoadMonitorMySQL::__construct (   $parent)

Construct a new LoadMonitor with a given LoadBalancer parent.

Parameters
LoadBalancer$parent

Implements LoadMonitor.

Definition at line 77 of file LoadMonitor.php.

References $parent.

Member Function Documentation

◆ getLagTimes()

LoadMonitorMySQL::getLagTimes (   $serverIndexes,
  $wiki 
)

Return an estimate of replication lag for each server.

Parameters
array$serverIndexes
string$wiki
Returns
array

Implements LoadMonitor.

Definition at line 84 of file LoadMonitor.php.

References $section, $wgMemc, array(), as, global, wfGetMainCache(), wfIncrStats(), and wfMemcKey().

◆ scaleLoads()

LoadMonitorMySQL::scaleLoads ( $loads,
  $group = false,
  $wiki = false 
)

Perform pre-connection load ratio adjustment.

Parameters
array$loads
string | bool$groupThe selected query group. Default: false
string | bool$wikiDefault: false

Implements LoadMonitor.

Definition at line 81 of file LoadMonitor.php.

Member Data Documentation

◆ $parent

LoadBalancer LoadMonitorMySQL::$parent

Definition at line 75 of file LoadMonitor.php.

Referenced by __construct().


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