You are here

function performance_cron in Performance Logging and Monitoring 7.2

Same name and namespace in other branches
  1. 5 performance.module \performance_cron()
  2. 6.2 performance.module \performance_cron()
  3. 6 performance.module \performance_cron()
  4. 7 performance.module \performance_cron()

Implements hook_cron().

File

./performance.module, line 97
Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com

Code

function performance_cron() {

  // Remove all entries that have expired.
  // TODO: make this work as expected, seems to throw away everything now :-s
  cache_clear_all(NULL, PERFORMANCE_BIN);

  // Remove entries that have less than so many accesses
  performance_traverse_cache('performance_cron_prune');

  // Remove performance_detail rows on a daily basis.
  if (variable_get('performance_detail', 0)) {
    performance_prune_details();
  }
}