* @ingroup Database
*/
+namespace Wikimedia\Rdbms;
+
use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use Wikimedia\ScopedCallback;
+use IDatabase;
+use BagOStuff;
/**
* Basic DB load monitor with no external dependencies
$this->parent = $lb;
$this->srvCache = $srvCache;
$this->mainCache = $cache;
- $this->replLogger = new \Psr\Log\NullLogger();
+ $this->replLogger = new NullLogger();
$this->movingAveRatio = isset( $options['movingAveRatio'] )
? $options['movingAveRatio']
continue;
}
- $lagTimes[$i] = $conn->getLag();
- if ( $lagTimes[$i] === false ) {
- $host = $this->parent->getServerName( $i );
- $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+ if ( $conn->getLBInfo( 'is static' ) ) {
+ $lagTimes[$i] = 0;
+ } else {
+ $lagTimes[$i] = $conn->getLag();
+ if ( $lagTimes[$i] === false ) {
+ $host = $this->parent->getServerName( $i );
+ $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+ }
}
if ( $close ) {