summaryrefslogtreecommitdiff
path: root/buildmaster/execution-times.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-07-26 10:53:50 +0200
committerErich Eckner <git@eckner.net>2019-07-26 10:53:50 +0200
commit2fe6e5380f561377ec1b7cf0c6f1fda4c2680f7d (patch)
treef12e7f966265b771b02206e1a878040afe975f64 /buildmaster/execution-times.php
parent14703b9448125a2901bc6e54823ab5d00df22d8e (diff)
downloadarchweb32-2fe6e5380f561377ec1b7cf0c6f1fda4c2680f7d.tar.xz
buildmaster/execution-times.php: only show statistics for last 7 days by default
Diffstat (limited to 'buildmaster/execution-times.php')
-rw-r--r--buildmaster/execution-times.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/buildmaster/execution-times.php b/buildmaster/execution-times.php
index cbe1cd5..cc1e064 100644
--- a/buildmaster/execution-times.php
+++ b/buildmaster/execution-times.php
@@ -5,6 +5,11 @@ require_once BASE . '/lib/mysql.php';
abort_iff_webspider();
+if (array_key_exists('from', $_GET))
+ $min_time = 'from_base64("' . base64_encode('-' . $_GET['from']) . '")';
+else
+ $min_time='"-7 00:00:00"';
+
$result = mysql_run_query(
'SELECT' .
' UNIX_TIMESTAMP(`ssh_log`.`date`) AS `date`,' .
@@ -12,7 +17,8 @@ $result = mysql_run_query(
'`ssh_log`.`action`,' .
'`ssh_log`.`parameters`' .
' FROM `ssh_log`' .
- ' WHERE `ssh_log`.`duration` IS NOT NULL' .
+ ' WHERE `ssh_log`.`date`>=ADDDATE(NOW(),' . $min_time . ')' .
+ ' AND `ssh_log`.`duration` IS NOT NULL' .
' AND `ssh_log`.`action` != "ping-from-slave"' .
' AND `ssh_log`.`exit_code` = 0' .
' ORDER BY `ssh_log`.`date`'