summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting
diff options
context:
space:
mode:
authorChristian Hofmaier2016-12-22 14:03:29 +0100
committerChristian Hofmaier2016-12-22 14:03:29 +0100
commit47a8eebcda2c841193420e6e7bb5ec847940f753 (patch)
tree11e820c9bd03181a33000c35a209545471673b7b /modules-available/statistics_reporting
parent[statistics_reporting] changed average to median (diff)
downloadslx-admin-47a8eebcda2c841193420e6e7bb5ec847940f753.tar.gz
slx-admin-47a8eebcda2c841193420e6e7bb5ec847940f753.tar.xz
slx-admin-47a8eebcda2c841193420e6e7bb5ec847940f753.zip
[statistics_reporting] better variable names
Diffstat (limited to 'modules-available/statistics_reporting')
-rw-r--r--modules-available/statistics_reporting/inc/statisticreporting.inc.php6
-rw-r--r--modules-available/statistics_reporting/page.inc.php6
2 files changed, 6 insertions, 6 deletions
diff --git a/modules-available/statistics_reporting/inc/statisticreporting.inc.php b/modules-available/statistics_reporting/inc/statisticreporting.inc.php
index d98ec168..2c4acaf1 100644
--- a/modules-available/statistics_reporting/inc/statisticreporting.inc.php
+++ b/modules-available/statistics_reporting/inc/statisticreporting.inc.php
@@ -87,13 +87,13 @@ class StatisticReporting
public static function getOverallStatistics ($cutOffTimeInSeconds, $lowerTimeBound = 0, $upperTimeBound = 24) {
$queryTime = time() - $cutOffTimeInSeconds;
- $res = Database::simpleQuery("SELECT sum, median, countLong, countShort FROM
- ( SELECT SUM(CAST(sessionTable.length AS UNSIGNED)) AS sum, GROUP_CONCAT(sessionTable.length) AS median, COUNT(*) AS countLong
+ $res = Database::simpleQuery("SELECT sum, median, longSessions, shortSessions FROM
+ ( SELECT SUM(CAST(sessionTable.length AS UNSIGNED)) AS sum, GROUP_CONCAT(sessionTable.length) AS median, COUNT(*) AS longSessions
FROM ".self::getBoundedTableQueryString('~session-length', $lowerTimeBound, $upperTimeBound)." sessionTable
WHERE sessionTable.dateline>=$queryTime AND sessionTable.data >= 60
) t1
INNER JOIN
- ( SELECT COUNT(sessionTable.length) as countShort
+ ( SELECT COUNT(sessionTable.length) as shortSessions
FROM ".self::getBoundedTableQueryString('~session-length', $lowerTimeBound, $upperTimeBound)." sessionTable
WHERE sessionTable.dateline>=$queryTime AND sessionTable.data < 60
) t2");
diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php
index 0dd4f243..de13cdb3 100644
--- a/modules-available/statistics_reporting/page.inc.php
+++ b/modules-available/statistics_reporting/page.inc.php
@@ -35,7 +35,7 @@ class Page_Statistics_Reporting extends Page
// total time online, average time online, total number of logins
$res = StatisticReporting::getOverallStatistics($cutOffTimer, $lowerTimeBound, $upperTimeBound);
$row = $res->fetch(PDO::FETCH_NUM);
- $data = array('time' => StatisticReporting::formatSeconds($row[0]), 'medianTime' => StatisticReporting::formatSeconds(StatisticReporting::calcMedian($row[1])), 'totalLogins' => $row[2]);
+ $data = array('time' => StatisticReporting::formatSeconds($row[0]), 'medianTime' => StatisticReporting::formatSeconds(StatisticReporting::calcMedian($row[1])), 'totalLogins' => $row[2], 'shortSessions' => $row[3]);
//total time offline
$res = StatisticReporting::getTotalOfflineStatistics($cutOffTimer, $lowerTimeBound, $upperTimeBound);
@@ -48,7 +48,7 @@ class Page_Statistics_Reporting extends Page
while ($row = $res->fetch(PDO::FETCH_NUM)) {
$median = StatisticReporting::calcMedian(StatisticReporting::calcMedian($row[2]));
$data['perLocation'][] = array('location' => $row[0], 'time' => StatisticReporting::formatSeconds($row[1]), 'timeInSeconds' => $row[1],
- 'medianTime' => StatisticReporting::formatSeconds($median), 'medianTimeInSeconds' => $median, 'offTime' => StatisticReporting::formatSeconds($row[3]), 'offlineTimeInSeconds' => $row[3], 'loginCount' => $row[4]);
+ 'medianTime' => StatisticReporting::formatSeconds($median), 'medianTimeInSeconds' => $median, 'offTime' => StatisticReporting::formatSeconds($row[3]), 'offlineTimeInSeconds' => $row[3], 'loginCount' => $row[4], 'shortSessions' => $row[5]);
}
// per client
@@ -58,7 +58,7 @@ class Page_Statistics_Reporting extends Page
$median = StatisticReporting::calcMedian(StatisticReporting::calcMedian($row[2]));
$data['perClient'][] = array('hostname' => $row[0], 'time' => StatisticReporting::formatSeconds($row[1]), 'timeInSeconds' => $row[1],
'medianTime' => StatisticReporting::formatSeconds($median), 'medianTimeInSeconds' => $median, 'offTime' => StatisticReporting::formatSeconds($row[3]), 'offlineTimeInSeconds' => $row[3], 'loginCount' => $row[4],
- 'lastLogout' => date(DATE_RSS,$row[5]), 'lastLogoutUnixtime' => $row[5], 'lastStart' => date(DATE_RSS,$row[6]), 'lastStartUnixtime' => $row[6]);
+ 'lastLogout' => date(DATE_RSS,$row[5]), 'lastLogoutUnixtime' => $row[5], 'lastStart' => date(DATE_RSS,$row[6]), 'lastStartUnixtime' => $row[6], 'shortSessions' => $row[7]);
}
// per user