callAggregateAllPlugins() public method

Instantiates the Archiver class in each plugin that defines it, and triggers Aggregation processing on these plugins.
public callAggregateAllPlugins ( $visits, $visitsConverted )
Esempio n. 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);
 }
 /**
  * @expectedException \Piwik\Tracker\Db\DbException
  * @expectedExceptionMessage Failed query foo bar - caused by plugin MyPluginName
  * @expectedExceptionCode 42
  */
 public function test_purgeOutdatedArchives_PurgesCorrectTemporaryArchives_WhileKeepingNewerTemporaryArchives_WithBrowserTriggeringEnabled()
 {
     $this->pluginsArchiver->callAggregateAllPlugins(1, 1);
 }
Esempio n. 3
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);
 }