You are here

function performance_prune_db in Performance Logging and Monitoring 7

Same name and namespace in other branches
  1. 6 performance.module \performance_prune_db()

Helper function to cleanup database data.

See also

performance_data_stores()

File

./performance.module, line 900
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_prune_db($timestamp = 0) {

  // Remove rows which have not been accessed since a certain timestamp
  db_delete('performance_summary')
    ->condition('last_access', $timestamp, '<=')
    ->execute();

  // Remove performance_detail rows on a daily basis
  // TODO: check the comment with the SQL. Which one is wrong? Look back in the
  // code history...
  db_delete('performance_detail')
    ->condition('timestamp', $timestamp, '<=')
    ->execute();
}