MediaWiki REL1_39
Wikimedia\Rdbms\ILoadMonitor Interface Reference

Database load monitoring interface. More...

Inheritance diagram for Wikimedia\Rdbms\ILoadMonitor:
Collaboration diagram for Wikimedia\Rdbms\ILoadMonitor:

Public Member Functions

 __construct (ILoadBalancer $lb, BagOStuff $sCache, WANObjectCache $wCache, array $options=[])
 Construct a new LoadMonitor with a given LoadBalancer parent.
 
 getLagTimes (array $serverIndexes, $domain)
 Get an estimate of replication lag (in seconds) for each server.
 
 scaleLoads (array &$weightByServer, $domain)
 Perform load ratio adjustment before deciding which server to use.
 
- Public Member Functions inherited from StatsdAwareInterface
 setStatsdDataFactory (StatsdDataFactoryInterface $statsFactory)
 Sets a StatsdDataFactory instance on the object.
 

Detailed Description

Database load monitoring interface.

Definition at line 32 of file ILoadMonitor.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\ILoadMonitor::__construct ( ILoadBalancer $lb,
BagOStuff $sCache,
WANObjectCache $wCache,
array $options = [] )

Construct a new LoadMonitor with a given LoadBalancer parent.

Parameters
ILoadBalancer$lbLoadBalancer this instance serves
BagOStuff$sCacheLocal server memory cache
WANObjectCache$wCacheLocal cluster memory cache
array$optionsOptions map

Implemented in Wikimedia\Rdbms\LoadMonitorNull, Wikimedia\Rdbms\LoadMonitor, and Wikimedia\Rdbms\LoadMonitorMySQL.

Member Function Documentation

◆ getLagTimes()

Wikimedia\Rdbms\ILoadMonitor::getLagTimes ( array $serverIndexes,
$domain )

Get an estimate of replication lag (in seconds) for each server.

Values may be "false" if replication is too broken to estimate

Parameters
int[]$serverIndexes
string$domain
Returns
array Map of (server index => float|int|false)

Implemented in Wikimedia\Rdbms\LoadMonitor, and Wikimedia\Rdbms\LoadMonitorNull.

◆ scaleLoads()

Wikimedia\Rdbms\ILoadMonitor::scaleLoads ( array & $weightByServer,
$domain )

Perform load ratio adjustment before deciding which server to use.

Parameters
int[]&$weightByServerMap of (server index => float weight)
string | false$domain

Implemented in Wikimedia\Rdbms\LoadMonitorNull, and Wikimedia\Rdbms\LoadMonitor.


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