diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-22 01:49:18 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-22 02:47:43 +0300 |
commit | c38cb2fe666b085d356451f8f71405fca0322615 (patch) | |
tree | 3ec28175185b9b580b15e30ca172e0641f58f3d1 /core/CronArchive.php | |
parent | 3393467c55e7c072e2e519ed1bf576eeb8953d0f (diff) |
#7723 Improved the archiver logging output
Diffstat (limited to 'core/CronArchive.php')
-rw-r--r-- | core/CronArchive.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index 88e926be65..044114c2d9 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -1581,7 +1581,11 @@ class CronArchive private function getUrlsWithSegment($idSite, $period, $date) { $urlsWithSegment = array(); - foreach ($this->getSegmentsForSite($idSite, $period) as $segment) { + $segments = $this->getSegmentsForSite($idSite, $period); + $segmentCount = count($segments); + $processedSegmentCount = 0; + + foreach ($segments as $segment) { $dateParamForSegment = $this->segmentArchivingRequestUrlProvider->getUrlParameterDateString($idSite, $period, $date, $segment); $urlWithSegment = $this->getVisitsRequestUrl($idSite, $period, $dateParamForSegment, $segment); @@ -1589,12 +1593,19 @@ class CronArchive $request = new Request($urlWithSegment); $self = $this; - $request->before(function () use ($self, $segment) { - $self->log('- pre-processing segment ' . $segment); + $request->before(function () use ($self, $segment, $segmentCount, &$processedSegmentCount) { + $processedSegmentCount++; + $self->log(sprintf( + '- pre-processing segment %d/%d %s', + $processedSegmentCount, + $segmentCount, + $segment + )); }); $urlsWithSegment[] = $request; } + return $urlsWithSegment; } |