27require_once __DIR__ .
'/Maintenance.php';
41 parent::__construct();
43 $this->
addOption(
'r',
"Don't exit immediately, but show the lag every 5 seconds" );
51 $serverCount = $lb->getServerCount();
52 for ( $i = 1; $i < $serverCount; $i++ ) {
53 $hostname = $lb->getServerName( $i );
54 $this->
output( sprintf(
"%-12s ", $hostname ) );
59 $lags = $lb->getLagTimes();
61 $this->
output( gmdate(
'H:i:s' ) .
' ' );
62 foreach ( $lags as $lag ) {
66 $lag ===
false ?
'replication stopped or errored' : $lag
72 }
while ( !$this->stopReporting );
75 $lags = $lb->getLagTimes();
76 foreach ( $lags as $i => $lag ) {
77 $name = $lb->getServerName( $i );
82 $lag ===
false ?
'replication stopped or errored' : $lag
92require_once RUN_MAINTENANCE_IF_MAIN;
Maintenance script to show database lag.
execute()
Do the actual work.
__construct()
Default constructor.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
hasOption( $name)
Checks to see if a particular option was set.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.