X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Flag.php;h=fa2bd54e036fad2e6b962c688d02050f3a7ccd82;hb=c86a06ae3b72f0f1dc5ad77b4d2641e61fac5c32;hp=410bf75655a355a89e242c2eab861660c53657e0;hpb=a492cf4c3498edbea090c5eccc2515b4d4a1724b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/lag.php b/maintenance/lag.php index 410bf75655..fa2bd54e03 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,14 +39,15 @@ 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 ); } echo "\n"; while ( 1 ) { - $lb->clearLagTimeCache(); $lags = $lb->getLagTimes(); unset( $lags[0] ); echo gmdate( 'H:i:s' ) . ' ';