MediaWiki master
ILoadMonitor.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use BagOStuff;
23use Psr\Log\LoggerAwareInterface;
26
33interface ILoadMonitor extends LoggerAwareInterface, StatsdAwareInterface {
34 public const STATE_UP = 'up';
35 public const STATE_LAG = 'lag';
36 public const STATE_AS_OF = 'time';
37 public const STATE_GEN_DELAY = 'delay';
38
47 public function __construct(
48 ILoadBalancer $lb, BagOStuff $sCache, WANObjectCache $wCache, array $options = []
49 );
50
56 public function scaleLoads( array &$weightByServer );
57
66 public function getLagTimes( array $serverIndexes ): array;
67
75 public function getServerStates( array $serverIndexes ): array;
76}
Class representing a cache/ephemeral data store.
Definition BagOStuff.php:85
Multi-datacenter aware caching interface.
Describes a Statsd aware interface.
This class is a delegate to ILBFactory for a given database cluster.
Database load monitoring interface.
getLagTimes(array $serverIndexes)
Get an estimate of replication lag (in seconds) for the specified servers.
scaleLoads(array &$weightByServer)
Perform load ratio adjustment before deciding which server to use.
__construct(ILoadBalancer $lb, BagOStuff $sCache, WANObjectCache $wCache, array $options=[])
Construct a new LoadMonitor with a given LoadBalancer parent.
getServerStates(array $serverIndexes)
Get a server gauge map for the specified servers.