MediaWiki  1.28.1
ILoadMonitor Interface Reference

An interface for database load monitoring. More...

Inheritance diagram for ILoadMonitor:
Collaboration diagram for ILoadMonitor:

Public Member Functions

 __construct (ILoadBalancer $lb, BagOStuff $sCache, BagOStuff $cCache, 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 30 of file ILoadMonitor.php.

Constructor & Destructor Documentation

ILoadMonitor::__construct ( ILoadBalancer  $lb,
BagOStuff  $sCache,
BagOStuff  $cCache,
array  $options = [] 
)

Construct a new LoadMonitor with a given LoadBalancer parent.

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

Implemented in LoadMonitor, LoadMonitorMySQL, and LoadMonitorNull.

Member Function Documentation

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
integer[]$serverIndexes
string$domain
Returns
array Map of (server index => float|int|bool)

Implemented in LoadMonitor, and LoadMonitorNull.

ILoadMonitor::scaleLoads ( array $weightByServer,
  $domain 
)

Perform load ratio adjustment before deciding which server to use.

Parameters
int[]&$weightByServer Map of (server index => float weight)
string | bool$domain

Implemented in LoadMonitor, and LoadMonitorNull.


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