You are here

function performance_log_details in Performance Logging and Monitoring 7.2

Same name and namespace in other branches
  1. 5 performance.module \performance_log_details()
  2. 6.2 includes/performance.details.inc \performance_log_details()
  3. 6 performance.module \performance_log_details()
  4. 7 performance.module \performance_log_details()

Helper function to store detailed data in database.

Parameters

$params: an array containing the following keys: mem, timer, query_count, query_timer anon, path, language, data.

Return value

void

1 call to performance_log_details()
performance_shutdown in ./performance.module
Shutdown function that collects all performance data.

File

includes/performance.details.inc, line 17
Performance module detail logging related functions. Can be overridden by adding $conf['performance_detail_logging'] = 'path/to/your/file' in settings.php.

Code

function performance_log_details($params) {
  $fields = array(
    'timestamp' => REQUEST_TIME,
    'bytes' => $params['mem'],
    'ms' => (int) $params['timer'],
    'query_count' => $params['query_count'],
    'query_timer' => (int) $params['query_timer'],
    'anon' => $params['anon'],
    'path' => $params['path'],
    'language' => $params['language'],
    'data' => $params['data'],
  );
  try {
    db_insert('performance_detail')
      ->fields($fields)
      ->execute();
  } catch (Exception $e) {
    watchdog_exception('performance', $e, NULL, array(), WATCHDOG_ERROR);
  }
}