You are here

function performance_db_get_data in Performance Logging and Monitoring 6

Same name and namespace in other branches
  1. 7 performance.module \performance_db_get_data()

Helper function to get data from the database.

Parameters

header table header array:

pager_height int num of rows per page:

time unix timestamp to start fetching data:

Return value

array of fetched data

2 calls to performance_db_get_data()
performance_get_data_db in ./performance.module
Wrapper function for consistency with the other data stores.
performance_view_summary in ./performance.module

File

./performance.module, line 870
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_db_get_data($header, $pager_height, $timestamp = 0) {
  $data_list = array();
  $sql = 'SELECT * FROM {performance_summary}';
  if ($timestamp) {
    $sql .= ' WHERE last_access >= %d';
    $result = db_query($sql, $timestamp);
  }
  else {

    // Add pager and tablesort.
    $sql .= tablesort_sql($header);
    $result = pager_query($sql, $pager_height);
  }
  while ($row = db_fetch_array($result)) {
    $data_list[] = $row;
  }
  return $data_list;
}