Skip to content
Extraits de code Groupes Projets
Valider 6dfc848b rédigé par mattab's avatar mattab
Parcourir les fichiers

Moving around

parent f3fcfa63
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -40,6 +40,13 @@ class Archiver extends \Piwik\Plugin\Archiver
$this->maximumRowsInSubDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_custom_variables'];
}
public function aggregateMultipleReports()
{
$this->getProcessor()->aggregateDataTableRecords(
self::CUSTOM_VARIABLE_RECORD_NAME, $this->maximumRowsInDataTableLevelZero, $this->maximumRowsInSubDataTable,
$columnToSort = Metrics::INDEX_NB_VISITS);
}
public function aggregateDayReport()
{
$this->dataArray = new DataArray();
......@@ -201,10 +208,4 @@ class Archiver extends \Piwik\Plugin\Archiver
}
}
public function aggregateMultipleReports()
{
$nameToCount = $this->getProcessor()->aggregateDataTableRecords(
self::CUSTOM_VARIABLE_RECORD_NAME, $this->maximumRowsInDataTableLevelZero, $this->maximumRowsInSubDataTable,
$columnToSort = Metrics::INDEX_NB_VISITS);
}
}
\ No newline at end of file
......@@ -42,13 +42,6 @@ class Archiver extends \Piwik\Plugin\Archiver
$this->aggregateByLabel(self::BROWSER_VERSION_DIMENSION, self::BROWSER_VERSION_RECORD_NAME);
}
private function aggregateByLabel($labelSQL, $recordName)
{
$metrics = $this->getLogAggregator()->getMetricsFromVisitByDimension($labelSQL)->asDataTable();
$report = $metrics->getSerialized($this->maximumRows, null, Metrics::INDEX_NB_VISITS);
$this->getProcessor()->insertBlobRecord($recordName, $report);
}
public function aggregateMultipleReports()
{
$dataTablesToSum = array(
......@@ -65,4 +58,12 @@ class Archiver extends \Piwik\Plugin\Archiver
$dt, $this->maximumRows, $this->maximumRows, $columnToSort = "nb_visits");
}
}
private function aggregateByLabel($labelSQL, $recordName)
{
$metrics = $this->getLogAggregator()->getMetricsFromVisitByDimension($labelSQL)->asDataTable();
$report = $metrics->getSerialized($this->maximumRows, null, Metrics::INDEX_NB_VISITS);
$this->getProcessor()->insertBlobRecord($recordName, $report);
}
}
\ No newline at end of file
......@@ -56,6 +56,19 @@ class Archiver extends \Piwik\Plugin\Archiver
$this->insertDayReports();
}
public function aggregateMultipleReports()
{
$dataTableToSum = array(
self::COUNTRY_RECORD_NAME,
self::REGION_RECORD_NAME,
self::CITY_RECORD_NAME,
);
$nameToCount = $this->getProcessor()->aggregateDataTableRecords($dataTableToSum);
$this->getProcessor()->insertNumericRecord(self::DISTINCT_COUNTRIES_METRIC,
$nameToCount[self::COUNTRY_RECORD_NAME]['level0']);
}
protected function aggregateFromVisits()
{
$additionalSelects = array('MAX(log_visit.location_latitude) as location_latitude',
......@@ -166,16 +179,4 @@ class Archiver extends \Piwik\Plugin\Archiver
}
}
public function aggregateMultipleReports()
{
$dataTableToSum = array(
self::COUNTRY_RECORD_NAME,
self::REGION_RECORD_NAME,
self::CITY_RECORD_NAME,
);
$nameToCount = $this->getProcessor()->aggregateDataTableRecords($dataTableToSum);
$this->getProcessor()->insertNumericRecord(self::DISTINCT_COUNTRIES_METRIC,
$nameToCount[self::COUNTRY_RECORD_NAME]['level0']);
}
}
\ No newline at end of file
......@@ -56,6 +56,24 @@ class Archiver extends \Piwik\Plugin\Archiver
$this->aggregateByLanguage();
}
/**
* Period archiving: simply sums up daily archives
*/
public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::CONFIGURATION_RECORD_NAME,
self::OS_RECORD_NAME,
self::BROWSER_RECORD_NAME,
self::BROWSER_TYPE_RECORD_NAME,
self::RESOLUTION_RECORD_NAME,
self::SCREEN_TYPE_RECORD_NAME,
self::PLUGIN_RECORD_NAME,
self::LANGUAGE_RECORD_NAME,
);
$this->getProcessor()->aggregateDataTableRecords($dataTableRecords, $this->maximumRows);
}
protected function aggregateByConfiguration()
{
$metrics = $this->getLogAggregator()->getMetricsFromVisitByDimension(self::CONFIGURATION_DIMENSION)->asDataTable();
......@@ -151,22 +169,5 @@ class Archiver extends \Piwik\Plugin\Archiver
return $this->getProcessor()->insertBlobRecord($recordName, $report);
}
/**
* Period archiving: simply sums up daily archives
*/
public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::CONFIGURATION_RECORD_NAME,
self::OS_RECORD_NAME,
self::BROWSER_RECORD_NAME,
self::BROWSER_TYPE_RECORD_NAME,
self::RESOLUTION_RECORD_NAME,
self::SCREEN_TYPE_RECORD_NAME,
self::PLUGIN_RECORD_NAME,
self::LANGUAGE_RECORD_NAME,
);
$this->getProcessor()->aggregateDataTableRecords($dataTableRecords, $this->maximumRows);
}
}
......@@ -26,6 +26,15 @@ class Archiver extends \Piwik\Plugin\Archiver
$this->aggregateByServerTime();
}
public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::LOCAL_TIME_RECORD_NAME,
self::SERVER_TIME_RECORD_NAME,
);
$this->getProcessor()->aggregateDataTableRecords($dataTableRecords);
}
protected function aggregateByServerTime()
{
$dataArray = $this->getLogAggregator()->getMetricsFromVisitByDimension(array("label" => "HOUR(log_visit.visit_last_action_time)"));
......@@ -76,12 +85,4 @@ class Archiver extends \Piwik\Plugin\Archiver
}
}
public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::LOCAL_TIME_RECORD_NAME,
self::SERVER_TIME_RECORD_NAME,
);
$this->getProcessor()->aggregateDataTableRecords($dataTableRecords);
}
}
\ No newline at end of file
......@@ -119,6 +119,17 @@ class Archiver extends \Piwik\Plugin\Archiver
}
}
public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::TIME_SPENT_RECORD_NAME,
self::PAGES_VIEWED_RECORD_NAME,
self::VISITS_COUNT_RECORD_NAME,
self::DAYS_SINCE_LAST_RECORD_NAME
);
$this->getProcessor()->aggregateDataTableRecords($dataTableRecords);
}
/**
* Transforms and returns the set of ranges used to calculate the 'visits by total time'
* report from ranges in minutes to equivalent ranges in seconds.
......@@ -139,14 +150,4 @@ class Archiver extends \Piwik\Plugin\Archiver
return $secondsGap;
}
public function aggregateMultipleReports()
{
$dataTableRecords = array(
self::TIME_SPENT_RECORD_NAME,
self::PAGES_VIEWED_RECORD_NAME,
self::VISITS_COUNT_RECORD_NAME,
self::DAYS_SINCE_LAST_RECORD_NAME
);
$this->getProcessor()->aggregateDataTableRecords($dataTableRecords);
}
}
\ No newline at end of file
Subproject commit b28a0c4455261b71968ece2e4c9c6d28053b596e
Subproject commit f514fce31bd8d803ad8b92e400f314550664400c
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter