MediaWiki REL1_28
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.
 
 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.
 

Detailed Description

An interface for database load monitoring.

Definition at line 30 of file ILoadMonitor.php.

Constructor & Destructor Documentation

◆ __construct()

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 LoadMonitorNull, LoadMonitor, and LoadMonitorMySQL.

Member Function Documentation

◆ getLagTimes()

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.

◆ scaleLoads()

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 LoadMonitorNull, and LoadMonitor.


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