Skip to content

Commit

Permalink
Merge pull request #343 from elbuit/issue-341
Browse files Browse the repository at this point in the history
 Add option to clean old perf_times table entries #341
  • Loading branch information
laf committed Nov 3, 2014
2 parents 30256d6 + 5b6ae9f commit 4e03575
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions daily.php
Expand Up @@ -48,5 +48,12 @@
}
}
}
if ($options['f'] === 'perf_times') {
if (is_numeric($config['perf_times_purge'])) {
if (dbDelete('perf_times', "start < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL ? DAY))", array($config['perf_times_purge'])) ) {
echo 'Performance poller times cleared for entries over ' . $config['perf_times_purge'] . " days\n";
}
}
}

?>
1 change: 1 addition & 0 deletions daily.sh
Expand Up @@ -10,3 +10,4 @@ fi
php daily.php -f syslog
php daily.php -f eventlog
php daily.php -f authlog
php daily.php -f perf_times
1 change: 1 addition & 0 deletions includes/defaults.inc.php
Expand Up @@ -576,6 +576,7 @@
$config['syslog_purge'] = 30; # Number in days of how long to keep syslog entries for.
$config['eventlog_purge'] = 30; # Number in days of how long to keep eventlog entries for.
$config['authlog_purge'] = 30; # Number in days of how long to keep authlog entries for.
$config['perf_times_purge'] = 30; # Number in days of how long to keep performace pooling stats entries for.

# Date format for PHP date()s
$config['dateformat']['long'] = "r"; # RFC2822 style
Expand Down

0 comments on commit 4e03575

Please sign in to comment.