MediaWiki master
Wikimedia\Rdbms\ILoadMonitor Interface Reference

Database load monitoring interface. More...

Inherits LoggerAwareInterface, and StatsdAwareInterface.

Inherited by Wikimedia\Rdbms\LoadMonitor.

Collaboration diagram for Wikimedia\Rdbms\ILoadMonitor:

Public Member Functions

 __construct (ILoadBalancer $lb, BagOStuff $sCache, WANObjectCache $wCache, $options)
 Construct a new LoadMonitor with a given LoadBalancer parent.
 scaleLoads (array &$weightByServer)
 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.

Public Attributes

const STATE_AS_OF = 'time'
const STATE_CONN_COUNT = 'conn_count'
const STATE_UP = 'up'

Detailed Description

Database load monitoring interface.

Access: internal
This class should not be called outside of LoadBalancer

Definition at line 33 of file ILoadMonitor.php.

Constructor & Destructor Documentation

◆ __construct()

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

Construct a new LoadMonitor with a given LoadBalancer parent.

ILoadBalancer$lbLoadBalancer this instance serves
BagOStuff$sCacheLocal server memory cache
WANObjectCache$wCacheLocal cluster memory cache
array$optionsAdditional parameters include:
  • maxConnCount: maximum number of connections before circuit breaking to kick in [default: infinity]

Implemented in Wikimedia\Rdbms\LoadMonitor.

Member Function Documentation

◆ scaleLoads()

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

Perform load ratio adjustment before deciding which server to use.

int[]&$weightByServerMap of (server index => float weight)

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

Member Data Documentation


const Wikimedia\Rdbms\ILoadMonitor::STATE_AS_OF = 'time'

Definition at line 36 of file ILoadMonitor.php.


const Wikimedia\Rdbms\ILoadMonitor::STATE_CONN_COUNT = 'conn_count'

Definition at line 35 of file ILoadMonitor.php.

Referenced by Wikimedia\Rdbms\LoadMonitor\scaleLoads().


const Wikimedia\Rdbms\ILoadMonitor::STATE_UP = 'up'

Definition at line 34 of file ILoadMonitor.php.

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