diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-19 03:47:35 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-19 03:47:35 +0400 |
commit | 7c55b6c4e3e86b07989c05e293f74e5c2ea25181 (patch) | |
tree | ca2271a4285e51e5ba96a896d0d081b14e9fda29 /plugins/DBStats/Controller.php | |
parent | e7534e41087d5c62e042ce1a1cbb3ea3faa00fd8 (diff) |
migrated DBStats to new reports definition and added possibility to not appear in report metadata
Diffstat (limited to 'plugins/DBStats/Controller.php')
-rw-r--r-- | plugins/DBStats/Controller.php | 129 |
1 files changed, 8 insertions, 121 deletions
diff --git a/plugins/DBStats/Controller.php b/plugins/DBStats/Controller.php index f8ec667893..959a807ba6 100644 --- a/plugins/DBStats/Controller.php +++ b/plugins/DBStats/Controller.php @@ -29,131 +29,18 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $view = new View('@DBStats/index'); $this->setBasicVariablesView($view); - $view->databaseUsageSummary = $this->getDatabaseUsageSummary(true); - $view->trackerDataSummary = $this->getTrackerDataSummary(true); - $view->metricDataSummary = $this->getMetricDataSummary(true); - $view->reportDataSummary = $this->getReportDataSummary(true); - $view->adminDataSummary = $this->getAdminDataSummary(true); + $view->databaseUsageSummary = $this->renderReport('getDatabaseUsageSummary'); + $view->trackerDataSummary = $this->renderReport('getTrackerDataSummary'); + $view->metricDataSummary = $this->renderReport('getMetricDataSummary'); + $view->reportDataSummary = $this->renderReport('getReportDataSummary'); + $view->adminDataSummary = $this->renderReport('getAdminDataSummary'); list($siteCount, $userCount, $totalSpaceUsed) = API::getInstance()->getGeneralInformation(); - $view->siteCount = MetricsFormatter::getPrettyNumber($siteCount); - $view->userCount = MetricsFormatter::getPrettyNumber($userCount); + + $view->siteCount = MetricsFormatter::getPrettyNumber($siteCount); + $view->userCount = MetricsFormatter::getPrettyNumber($userCount); $view->totalSpaceUsed = MetricsFormatter::getPrettySizeFromBytes($totalSpaceUsed); return $view->render(); } - - /** - * Shows a datatable that displays how much space the tracker tables, numeric - * archive tables, report tables and other tables take up in the MySQL database. - * - * @return string - */ - public function getDatabaseUsageSummary() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays the amount of space each individual log table - * takes up in the MySQL database. - * @return string|void - */ - public function getTrackerDataSummary() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays the amount of space each numeric archive table - * takes up in the MySQL database. - * - * @return string|void - */ - public function getMetricDataSummary() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays the amount of space each numeric archive table - * takes up in the MySQL database, for each year of numeric data. - * - * @return string|void - */ - public function getMetricDataSummaryByYear() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays the amount of space each blob archive table - * takes up in the MySQL database. - * - * @return string|void - */ - public function getReportDataSummary() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays the amount of space each blob archive table - * takes up in the MySQL database, for each year of blob data. - * - * @return string|void - */ - public function getReportDataSummaryByYear() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays how many occurances there are of each individual - * report type stored in the MySQL database. - * - * Goal reports and reports of the format: .*_[0-9]+ are grouped together. - * - * @return string|void - */ - public function getIndividualReportsSummary() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays how many occurances there are of each individual - * metric type stored in the MySQL database. - * - * Goal metrics, metrics of the format .*_[0-9]+ and 'done...' metrics are grouped together. - * - * @return string|void - */ - public function getIndividualMetricsSummary() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } - - /** - * Shows a datatable that displays the amount of space each 'admin' table takes - * up in the MySQL database. - * - * An 'admin' table is a table that is not central to analytics functionality. - * So any table that isn't an archive table or a log table is an 'admin' table. - * - * @return string|void - */ - public function getAdminDataSummary() - { - Piwik::checkUserHasSuperUserAccess(); - return $this->renderReport(__FUNCTION__); - } } |