diff options
author | Steffen Ritter | 2024-01-25 14:47:37 +0100 |
---|---|---|
committer | Steffen Ritter | 2024-01-25 14:47:37 +0100 |
commit | 5dd6473d2f78d74c005ed20fb2a968f9bcae6ade (patch) | |
tree | 911b84024df5c77ac2b3f9638f8dbcdfc145f30a /modules-available | |
parent | [statistics] Keep statistics longer for analysis (diff) | |
download | slx-admin-5dd6473d2f78d74c005ed20fb2a968f9bcae6ade.tar.gz slx-admin-5dd6473d2f78d74c005ed20fb2a968f9bcae6ade.tar.xz slx-admin-5dd6473d2f78d74c005ed20fb2a968f9bcae6ade.zip |
[statistics_reporting] Consider all machines in DB
Don't limit on machines which booted at least once in the last 30 days.
Otherwise the number of machines in statistics_reporting doesn't match
the number of clients in rooms/locations or client-statistics which is
kinda irritating.
We still have the problem, that we don't know which clients still exist
in the real world. But that' another story.
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/statistics_reporting/inc/queries.inc.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules-available/statistics_reporting/inc/queries.inc.php b/modules-available/statistics_reporting/inc/queries.inc.php index bafe80bc..6446a89b 100644 --- a/modules-available/statistics_reporting/inc/queries.inc.php +++ b/modules-available/statistics_reporting/inc/queries.inc.php @@ -15,7 +15,8 @@ class Queries public static function getClientStatistics(int $from, int $to, int $lowerTimeBound = 0, int $upperTimeBound = 24): array { - $fromCutoff = $from - 86400 * 30; + #$fromCutoff = $from - 86400 * 30; + $fromCutoff = 0; $res = Database::simpleQuery("SELECT m.machineuuid, m.hostname, m.clientip, m.locationid, m.firstseen -- , m.lastboot, m.logintime, m.state FROM machine m WHERE firstseen <= $to AND lastseen > $fromCutoff"); // " WHERE lastseen >= :from", compact('from')); @@ -30,7 +31,8 @@ class Queries public static function getLocationStatistics(int $from, int $to, int $lowerTimeBound = 0, int $upperTimeBound = 24): array { - $fromCutoff = $from - 86400 * 30; + #$fromCutoff = $from - 86400 * 30; + $fromCutoff = 0; $res = Database::simpleQuery("SELECT m.machineuuid, m.hostname, m.clientip, m.locationid, m.firstseen -- , m.lastboot, m.logintime, m.state FROM machine m WHERE firstseen <= $to AND lastseen > $fromCutoff"); // " WHERE lastseen >= :from", compact('from')); @@ -62,7 +64,8 @@ class Queries public static function getOverallStatistics(int $from, int $to, $lowerTimeBound = 0, $upperTimeBound = 24) { - $fromCutoff = $from - 86400 * 30; + #$fromCutoff = $from - 86400 * 30; + $fromCutoff = 0; $res = Database::simpleQuery("SELECT m.machineuuid, m.hostname, m.clientip, m.locationid, m.firstseen -- , m.lastboot, m.logintime, m.state FROM machine m WHERE firstseen <= $to AND lastseen > $fromCutoff"); // " WHERE lastseen >= :from", compact('from')); |