From c78d9d37f89af8cba24e8ca95deccae38d20f60b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 15 Sep 2009 00:24:24 +0000 Subject: [PATCH] De-Wikimedified lag.php script and merged to trunk. Still not 100% sure what the -r option is supposed to do, but it now runs. :) --- maintenance/lag.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 maintenance/lag.php diff --git a/maintenance/lag.php b/maintenance/lag.php new file mode 100644 index 0000000000..6d0e76ee1d --- /dev/null +++ b/maintenance/lag.php @@ -0,0 +1,33 @@ +getServerCount(); $i++ ) { + $hostname = $lb->getServerName( $i ); + printf("%-12s ", $hostname ); + } + print("\n"); + + while( 1 ) { + $lags = $lb->getLagTimes(); + unset( $lags[0] ); + print( gmdate( 'H:i:s' ) . ' ' ); + foreach( $lags as $i => $lag ) { + printf("%-12s " , $lag === false ? 'false' : $lag ); + } + print("\n"); + sleep(5); + } +} else { + $lb = wfGetLB(); + $lags = $lb->getLagTimes(); + foreach( $lags as $i => $lag ) { + $name = $lb->getServerName( $i ); + printf("%-20s %s\n" , $name, $lag === false ? 'false' : $lag ); + } +} +?> -- 2.20.1