45 $lb = $this->getServiceContainer()->getDBLoadBalancer();
46 if ( $this->hasOption(
'r' ) ) {
47 $this->output(
'time ' );
49 $serverCount = $lb->getServerCount();
50 for ( $i = 1; $i < $serverCount; $i++ ) {
51 $hostname = $lb->getServerName( $i );
52 $this->output( sprintf(
"%-12s ", $hostname ) );
54 $this->output(
"\n" );
57 $lags = $lb->getLagTimes();
59 $this->output( gmdate(
'H:i:s' ) .
' ' );
60 foreach ( $lags as $lag ) {
64 $lag ===
false ?
'replication stopped or errored' : $lag
68 $this->output(
"\n" );
70 }
while ( !$this->stopReporting );
73 $lags = $lb->getLagTimes();
74 foreach ( $lags as $i => $lag ) {
75 $name = $lb->getServerName( $i );
80 $lag ===
false ?
'replication stopped or errored' : $lag