From 2fe6e5380f561377ec1b7cf0c6f1fda4c2680f7d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 26 Jul 2019 10:53:50 +0200 Subject: buildmaster/execution-times.php: only show statistics for last 7 days by default --- buildmaster/execution-times.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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`' -- cgit v1.2.3-70-g09d2