X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Flag.php;h=9d9279412963ad9269a59d12cae16366adb2c00f;hb=52cc0c249e95ba757b4a02d2f5633d0e1a71f8f2;hp=410bf75655a355a89e242c2eab861660c53657e0;hpb=5c5fb511c70346a660cb6aa388cc677e11d3bdab;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/lag.php b/maintenance/lag.php index 410bf75655..9d92794129 100644 --- a/maintenance/lag.php +++ b/maintenance/lag.php @@ -31,7 +31,7 @@ require_once __DIR__ . '/Maintenance.php'; class DatabaseLag extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Shows database lag"; + $this->addDescription( 'Shows database lag' ); $this->addOption( 'r', "Don't exit immediately, but show the lag every 5 seconds" ); } @@ -39,7 +39,9 @@ class DatabaseLag extends Maintenance { if ( $this->hasOption( 'r' ) ) { $lb = wfGetLB(); echo 'time '; - for ( $i = 1; $i < $lb->getServerCount(); $i++ ) { + + $serverCount = $lb->getServerCount(); + for ( $i = 1; $i < $serverCount; $i++ ) { $hostname = $lb->getServerName( $i ); printf( "%-12s ", $hostname ); }