r56350 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56349‎ | r56350 | r56351 >
Date:00:24, 15 September 2009
Author:brion
Status:ok
Tags:
Comment:
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. :)
Modified paths:
  • /trunk/phase3/maintenance/lag.php (added) (history)

Diff [purge]

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
135 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r56374Merge post-branch trunk updates replacing old live hacks:...brion17:25, 15 September 2009

Status & tagging log