callAggregateCoreMetrics() public method

If period is != day, will sum the core metrics from the existing archives.
public callAggregateCoreMetrics ( ) : array
return array Core metrics
Beispiel #1
0
 protected function prepareAllPluginsArchive($visits, $visitsConverted)
 {
     $pluginsArchiver = new PluginsArchiver($this->params, $this->isArchiveTemporary());
     if ($this->mustProcessVisitCount($visits) || $this->doesRequestedPluginIncludeVisitsSummary()) {
         $metrics = $pluginsArchiver->callAggregateCoreMetrics();
         $visits = $metrics['nb_visits'];
         $visitsConverted = $metrics['nb_visits_converted'];
     }
     if ($this->isThereSomeVisits($visits)) {
         $pluginsArchiver->callAggregateAllPlugins($visits, $visitsConverted);
     }
     $idArchive = $pluginsArchiver->finalizeArchive();
     if (!$this->params->isSingleSiteDayArchive() && $visits) {
         ArchiveSelector::purgeOutdatedArchives($this->params->getPeriod()->getDateStart());
     }
     return array($idArchive, $visits);
 }
Beispiel #2
0
 protected function prepareAllPluginsArchive($visits, $visitsConverted)
 {
     $pluginsArchiver = new PluginsArchiver($this->params, $this->isArchiveTemporary());
     if ($this->mustProcessVisitCount($visits) || $this->doesRequestedPluginIncludeVisitsSummary()) {
         $metrics = $pluginsArchiver->callAggregateCoreMetrics();
         $visits = $metrics['nb_visits'];
         $visitsConverted = $metrics['nb_visits_converted'];
     }
     if ($this->isThereSomeVisits($visits)) {
         $pluginsArchiver->callAggregateAllPlugins($visits, $visitsConverted);
     }
     $idArchive = $pluginsArchiver->finalizeArchive();
     return array($idArchive, $visits);
 }