X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Flibs%2Frdbms%2Floadmonitor%2FLoadMonitor.php;h=50c878d06b4069ebaf4449d8b6d685be66ef1095;hb=da4e15e219563899acd565650d3ea5261fed9451;hp=74c776584416aca7b6d7155b7e0cdcd698607e1b;hpb=64a6afaf6964b3f9e61d595d5586fe7428a57e73;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php b/includes/libs/rdbms/loadmonitor/LoadMonitor.php index 74c7765844..50c878d06b 100644 --- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php +++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php @@ -81,13 +81,13 @@ class LoadMonitor implements ILoadMonitor { $this->replLogger = $logger; } - public function scaleLoads( array &$weightByServer, $domain ) { + final public function scaleLoads( array &$weightByServer, $domain ) { $serverIndexes = array_keys( $weightByServer ); $states = $this->getServerStates( $serverIndexes, $domain ); - $coefficientsByServer = $states['weightScales']; + $newScalesByServer = $states['weightScales']; foreach ( $weightByServer as $i => $weight ) { - if ( isset( $coefficientsByServer[$i] ) ) { - $weightByServer[$i] = $weight * $coefficientsByServer[$i]; + if ( isset( $newScalesByServer[$i] ) ) { + $weightByServer[$i] = $weight * $newScalesByServer[$i]; } else { // server recently added to config? $host = $this->parent->getServerName( $i ); $this->replLogger->error( __METHOD__ . ": host $host not in cache" ); @@ -95,10 +95,8 @@ class LoadMonitor implements ILoadMonitor { } } - public function getLagTimes( array $serverIndexes, $domain ) { - $states = $this->getServerStates( $serverIndexes, $domain ); - - return $states['lagTimes']; + final public function getLagTimes( array $serverIndexes, $domain ) { + return $this->getServerStates( $serverIndexes, $domain )['lagTimes']; } protected function getServerStates( array $serverIndexes, $domain ) {