r80904 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80903‎ | r80904 | r80905 >
Date:20:05, 24 January 2011
Author:catrope
Status:ok
Tags:
Comment:
1.16wmf4: Committing local change to populateRevisionLength.php making it more verbose but making the batch size larger
Modified paths:
  • /branches/wmf/1.16wmf4/maintenance/populateRevisionLength.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/maintenance/populateRevisionLength.php
@@ -26,11 +26,12 @@
2727 public function __construct() {
2828 parent::__construct();
2929 $this->mDescription = "Populates rev_len";
30 - $this->setBatchSize( 200 );
 30+ $this->setBatchSize( 2000 );
3131 }
3232
3333 public function execute() {
3434 $db = wfGetDB( DB_MASTER );
 35+ $wiki = $db->getWikiID();
3536 if ( !$db->tableExists( 'revision' ) ) {
3637 $this->error( "revision table does not exist", true );
3738 }
@@ -51,7 +52,8 @@
5253 $count = 0;
5354 $missing = 0;
5455 while( $blockStart <= $end ) {
55 - $this->output( "...doing rev_id from $blockStart to $blockEnd\n" );
 56+ $this->output( "$wiki ... doing rev_id from $blockStart to $blockEnd (total: $end) " );
 57+ $tstart=microtime( true );
5658 $res = $db->select( 'revision',
5759 Revision::selectFields(),
5860 array( "rev_id >= $blockStart",
@@ -78,6 +80,10 @@
7981 }
8082 $blockStart += $this->mBatchSize;
8183 $blockEnd += $this->mBatchSize;
 84+ $tend = microtime( true );
 85+ $tspent = $tend - $tstart;
 86+ $testimated = ($end - $blockEnd)*1.0 / ($blockEnd - $blockStart) * $tspent /3600;
 87+ $this->output( sprintf( " in %01.2f seconds, estimated completion in %01.1f hours\n", $tspent, $testimated ) );
8288 wfWaitForSlaves( 5 );
8389 }
8490 $logged = $db->insert( 'updatelog',

Status & tagging log