function performance_log_details in Performance Logging and Monitoring 7
Same name and namespace in other branches
- 5 performance.module \performance_log_details()
- 6.2 includes/performance.details.inc \performance_log_details()
- 6 performance.module \performance_log_details()
- 7.2 includes/performance.details.inc \performance_log_details()
Helper function to store detailed data in database.
1 call to performance_log_details()
- performance_shutdown in ./
performance.module - Shutdown function that collects all performance data.
File
- ./
performance.module, line 928 - 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_log_details($params = array()) {
global $user;
$fields = array(
'timestamp' => REQUEST_TIME,
'bytes' => $params['mem'],
'ms' => (int) $params['timer'],
'query_count' => $params['query_count'],
'query_timer' => (int) $params['query_timer'],
'anon' => $user->uid ? 0 : 1,
'path' => $params['path'],
'data' => $params['data'],
);
try {
db_insert('performance_detail')
->fields($fields)
->execute();
} catch (Exception $e) {
drupal_set_message($e
->getMessage(), 'error');
}
}