MediaWiki  1.34.0
Wikimedia\Rdbms\ILoadMonitor Interface Reference

An interface for database load monitoring. 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. More...
 
 getLagTimes (array $serverIndexes, $domain)
 Get an estimate of replication lag (in seconds) for each server. More...
 
 scaleLoads (array &$weightByServer, $domain)
 Perform load ratio adjustment before deciding which server to use. More...
 

Detailed Description

An interface for database load monitoring.

Definition at line 35 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\LoadMonitor, Wikimedia\Rdbms\LoadMonitorMySQL, and Wikimedia\Rdbms\LoadMonitorNull.

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|bool)

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 | bool$domain

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


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