http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56350

Revision: 56350
Author:   brion
Date:     2009-09-15 00:24:24 +0000 (Tue, 15 Sep 2009)

Log Message:
-----------
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. :)

Added Paths:
-----------
    trunk/phase3/maintenance/lag.php

Added: trunk/phase3/maintenance/lag.php
===================================================================
--- trunk/phase3/maintenance/lag.php                            (rev 0)
+++ trunk/phase3/maintenance/lag.php    2009-09-15 00:24:24 UTC (rev 56350)
@@ -0,0 +1,33 @@
+<?php
+
+$wgUseNormalUser = true;
+require_once('commandLine.inc');
+
+if ( isset( $options['r'] ) ) {
+       $lb = wfGetLB();
+       print 'time     ';
+       for( $i = 0; $i < $lb->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 );
+       }
+}
+?>


Property changes on: trunk/phase3/maintenance/lag.php
___________________________________________________________________
Added: svn:eol-style
   + native



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to