/** * Overridden to include prefetch ratio if enabled. */ function showReport() { if (!$this->prefetch) { return parent::showReport(); } if ($this->reporting) { $delta = wfTime() - $this->startTime; $now = wfTimestamp(TS_DB); if ($delta) { $rate = $this->pageCount / $delta; $revrate = $this->revCount / $delta; $portion = $this->revCount / $this->maxCount; $eta = $this->startTime + $delta / $portion; $etats = wfTimestamp(TS_DB, intval($eta)); $fetchrate = 100.0 * $this->prefetchCount / $this->fetchCount; } else { $rate = '-'; $revrate = '-'; $etats = '-'; $fetchrate = '-'; } $this->progress(sprintf("%s: %s %d pages (%0.3f/sec), %d revs (%0.3f/sec), %0.1f%% prefetched, ETA %s [max %d]", $now, wfWikiID(), $this->pageCount, $rate, $this->revCount, $revrate, $fetchrate, $etats, $this->maxCount)); } }
/** * Overridden to include prefetch ratio if enabled. */ function showReport() { if (!$this->prefetch) { return parent::showReport(); } if ($this->reporting) { $now = wfTimestamp(TS_DB); $nowts = wfTime(); $deltaAll = wfTime() - $this->startTime; $deltaPart = wfTime() - $this->lastTime; $this->pageCountPart = $this->pageCount - $this->pageCountLast; $this->revCountPart = $this->revCount - $this->revCountLast; if ($deltaAll) { $portion = $this->revCount / $this->maxCount; $eta = $this->startTime + $deltaAll / $portion; $etats = wfTimestamp(TS_DB, intval($eta)); if ($this->fetchCount) { $fetchRate = 100.0 * $this->prefetchCount / $this->fetchCount; } else { $fetchRate = '-'; } $pageRate = $this->pageCount / $deltaAll; $revRate = $this->revCount / $deltaAll; } else { $pageRate = '-'; $revRate = '-'; $etats = '-'; $fetchRate = '-'; } if ($deltaPart) { if ($this->fetchCountLast) { $fetchRatePart = 100.0 * $this->prefetchCountLast / $this->fetchCountLast; } else { $fetchRatePart = '-'; } $pageRatePart = $this->pageCountPart / $deltaPart; $revRatePart = $this->revCountPart / $deltaPart; } else { $fetchRatePart = '-'; $pageRatePart = '-'; $revRatePart = '-'; } $this->progress(sprintf("%s: %s (ID %d) %d pages (%0.1f|%0.1f/sec all|curr), %d revs (%0.1f|%0.1f/sec all|curr), %0.1f%%|%0.1f%% prefetched (all|curr), ETA %s [max %d]", $now, wfWikiID(), $this->ID, $this->pageCount, $pageRate, $pageRatePart, $this->revCount, $revRate, $revRatePart, $fetchRate, $fetchRatePart, $etats, $this->maxCount)); $this->lastTime = $nowts; $this->revCountLast = $this->revCount; $this->prefetchCountLast = $this->prefetchCount; $this->fetchCountLast = $this->fetchCount; } }