Remove usage of wfTime() in maintenance
This function is only a wrapper to microtime( true ), so it can easily be replaced and deprecated at some point. Change-Id: I26f77d3cb02cc517ecf51262a4684084a7ce7825
This commit is contained in:
parent
deaa3648e6
commit
e4ab0f83db
8 changed files with 19 additions and 19 deletions
|
|
@ -259,7 +259,7 @@ class BackupDumper {
|
|||
$dbr = wfGetDB( DB_SLAVE );
|
||||
}
|
||||
$this->maxCount = $dbr->selectField( $table, "MAX($field)", '', __METHOD__ );
|
||||
$this->startTime = wfTime();
|
||||
$this->startTime = microtime( true );
|
||||
$this->lastTime = $this->startTime;
|
||||
$this->ID = getmypid();
|
||||
}
|
||||
|
|
@ -328,9 +328,9 @@ class BackupDumper {
|
|||
function showReport() {
|
||||
if ( $this->reporting ) {
|
||||
$now = wfTimestamp( TS_DB );
|
||||
$nowts = wfTime();
|
||||
$deltaAll = wfTime() - $this->startTime;
|
||||
$deltaPart = wfTime() - $this->lastTime;
|
||||
$nowts = microtime( true );
|
||||
$deltaAll = $nowts - $this->startTime;
|
||||
$deltaPart = $nowts - $this->lastTime;
|
||||
$this->pageCountPart = $this->pageCount - $this->pageCountLast;
|
||||
$this->revCountPart = $this->revCount - $this->revCountLast;
|
||||
|
||||
|
|
|
|||
|
|
@ -247,9 +247,9 @@ class TextPassDumper extends BackupDumper {
|
|||
|
||||
if ( $this->reporting ) {
|
||||
$now = wfTimestamp( TS_DB );
|
||||
$nowts = wfTime();
|
||||
$deltaAll = wfTime() - $this->startTime;
|
||||
$deltaPart = wfTime() - $this->lastTime;
|
||||
$nowts = microtime( true );
|
||||
$deltaAll = $nowts - $this->startTime;
|
||||
$deltaPart = $nowts - $this->lastTime;
|
||||
$this->pageCountPart = $this->pageCount - $this->pageCountLast;
|
||||
$this->revCountPart = $this->revCount - $this->revCountLast;
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class TableCleanup extends Maintenance {
|
|||
$this->processed = 0;
|
||||
$this->updated = 0;
|
||||
$this->count = $count;
|
||||
$this->startTime = wfTime();
|
||||
$this->startTime = microtime( true );
|
||||
$this->table = $table;
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ class TableCleanup extends Maintenance {
|
|||
$portion = $this->processed / $this->count;
|
||||
$updateRate = $this->updated / $this->processed;
|
||||
|
||||
$now = wfTime();
|
||||
$now = microtime( true );
|
||||
$delta = $now - $this->startTime;
|
||||
$estimatedTotalTime = $delta / $portion;
|
||||
$eta = $this->startTime + $estimatedTotalTime;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ abstract class DumpIterator extends Maintenance {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->startTime = wfTime();
|
||||
$this->startTime = microtime( true );
|
||||
|
||||
if ( $this->getOption('dump') == '-' ) {
|
||||
$source = new ImportStreamSource( $this->getStdin() );
|
||||
|
|
@ -80,7 +80,7 @@ abstract class DumpIterator extends Maintenance {
|
|||
|
||||
$this->conclusions();
|
||||
|
||||
$delta = wfTime() - $this->startTime;
|
||||
$delta = microtime( true ) - $this->startTime;
|
||||
$this->error( "Done {$this->count} revisions in " . round($delta, 2) . " seconds " );
|
||||
if ($delta > 0)
|
||||
$this->error( round($this->count / $delta, 2) . " pages/sec" );
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ TEXT;
|
|||
|
||||
function showReport() {
|
||||
if ( !$this->mQuiet ) {
|
||||
$delta = wfTime() - $this->startTime;
|
||||
$delta = microtime( true ) - $this->startTime;
|
||||
if ( $delta ) {
|
||||
$rate = sprintf( "%.2f", $this->pageCount / $delta );
|
||||
$revrate = sprintf( "%.2f", $this->revCount / $delta );
|
||||
|
|
@ -254,7 +254,7 @@ TEXT;
|
|||
}
|
||||
|
||||
function importFromHandle( $handle ) {
|
||||
$this->startTime = wfTime();
|
||||
$this->startTime = microtime( true );
|
||||
|
||||
$source = new ImportStreamSource( $handle );
|
||||
$importer = new WikiImporter( $source );
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class ImageBuilder extends Maintenance {
|
|||
$this->processed = 0;
|
||||
$this->updated = 0;
|
||||
$this->count = $count;
|
||||
$this->startTime = wfTime();
|
||||
$this->startTime = microtime( true );
|
||||
$this->table = $table;
|
||||
}
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ class ImageBuilder extends Maintenance {
|
|||
$portion = $this->processed / $this->count;
|
||||
$updateRate = $this->updated / $this->processed;
|
||||
|
||||
$now = wfTime();
|
||||
$now = microtime( true );
|
||||
$delta = $now - $this->startTime;
|
||||
$estimatedTotalTime = $delta / $portion;
|
||||
$eta = $this->startTime + $estimatedTotalTime;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class DumpRenderer extends Maintenance {
|
|||
public function execute() {
|
||||
$this->outputDirectory = $this->getOption( 'output-dir' );
|
||||
$this->prefix = $this->getOption( 'prefix', 'wiki' );
|
||||
$this->startTime = wfTime();
|
||||
$this->startTime = microtime( true );
|
||||
|
||||
if ( $this->hasOption( 'parser' ) ) {
|
||||
global $wgParserConf;
|
||||
|
|
@ -68,7 +68,7 @@ class DumpRenderer extends Maintenance {
|
|||
|
||||
$importer->doImport();
|
||||
|
||||
$delta = wfTime() - $this->startTime;
|
||||
$delta = microtime( true ) - $this->startTime;
|
||||
$this->error( "Rendered {$this->count} pages in " . round($delta, 2) . " seconds " );
|
||||
if ($delta > 0)
|
||||
$this->error( round($this->count / $delta, 2) . " pages/sec" );
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ class FiveUpgrade extends Maintenance {
|
|||
$this->chunkSize = $chunksize;
|
||||
$this->chunkFinal = $final;
|
||||
$this->chunkCount = 0;
|
||||
$this->chunkStartTime = wfTime();
|
||||
$this->chunkStartTime = microtime( true );
|
||||
$this->chunkOptions = array( 'IGNORE' );
|
||||
$this->chunkTable = $table;
|
||||
$this->chunkFunction = $fname;
|
||||
|
|
@ -273,7 +273,7 @@ class FiveUpgrade extends Maintenance {
|
|||
$this->insertChunk( $chunk );
|
||||
|
||||
$this->chunkCount += count( $chunk );
|
||||
$now = wfTime();
|
||||
$now = microtime( true );
|
||||
$delta = $now - $this->chunkStartTime;
|
||||
$rate = $this->chunkCount / $delta;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue