Index: trunk/phase3/maintenance/lag.php |
— | — | @@ -0,0 +1,33 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +$wgUseNormalUser = true; |
| 5 | +require_once('commandLine.inc'); |
| 6 | + |
| 7 | +if ( isset( $options['r'] ) ) { |
| 8 | + $lb = wfGetLB(); |
| 9 | + print 'time '; |
| 10 | + for( $i = 0; $i < $lb->getServerCount(); $i++ ) { |
| 11 | + $hostname = $lb->getServerName( $i ); |
| 12 | + printf("%-12s ", $hostname ); |
| 13 | + } |
| 14 | + print("\n"); |
| 15 | + |
| 16 | + while( 1 ) { |
| 17 | + $lags = $lb->getLagTimes(); |
| 18 | + unset( $lags[0] ); |
| 19 | + print( gmdate( 'H:i:s' ) . ' ' ); |
| 20 | + foreach( $lags as $i => $lag ) { |
| 21 | + printf("%-12s " , $lag === false ? 'false' : $lag ); |
| 22 | + } |
| 23 | + print("\n"); |
| 24 | + sleep(5); |
| 25 | + } |
| 26 | +} else { |
| 27 | + $lb = wfGetLB(); |
| 28 | + $lags = $lb->getLagTimes(); |
| 29 | + foreach( $lags as $i => $lag ) { |
| 30 | + $name = $lb->getServerName( $i ); |
| 31 | + printf("%-20s %s\n" , $name, $lag === false ? 'false' : $lag ); |
| 32 | + } |
| 33 | +} |
| 34 | +?> |
Property changes on: trunk/phase3/maintenance/lag.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 35 | + native |