Index: branches/wmf/1.16wmf4/maintenance/populateRevisionLength.php |
— | — | @@ -26,11 +26,12 @@ |
27 | 27 | public function __construct() { |
28 | 28 | parent::__construct(); |
29 | 29 | $this->mDescription = "Populates rev_len"; |
30 | | - $this->setBatchSize( 200 ); |
| 30 | + $this->setBatchSize( 2000 ); |
31 | 31 | } |
32 | 32 | |
33 | 33 | public function execute() { |
34 | 34 | $db = wfGetDB( DB_MASTER ); |
| 35 | + $wiki = $db->getWikiID(); |
35 | 36 | if ( !$db->tableExists( 'revision' ) ) { |
36 | 37 | $this->error( "revision table does not exist", true ); |
37 | 38 | } |
— | — | @@ -51,7 +52,8 @@ |
52 | 53 | $count = 0; |
53 | 54 | $missing = 0; |
54 | 55 | 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 ); |
56 | 58 | $res = $db->select( 'revision', |
57 | 59 | Revision::selectFields(), |
58 | 60 | array( "rev_id >= $blockStart", |
— | — | @@ -78,6 +80,10 @@ |
79 | 81 | } |
80 | 82 | $blockStart += $this->mBatchSize; |
81 | 83 | $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 ) ); |
82 | 88 | wfWaitForSlaves( 5 ); |
83 | 89 | } |
84 | 90 | $logged = $db->insert( 'updatelog', |