You are here

function performance_log_summary_zend in Performance Logging and Monitoring 6

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

Helper function to store summary data in Zend Datacache.

See also

performance_data_stores()

File

./performance.module, line 729
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_summary_zend($params = array()) {
  $key = PERFORMANCE_ZEND_NAMESPACE . '::' . $params['path'];
  $result = performance_build_summary_data(zend_shm_cache_fetch($key), $params, 'zend');
  if ($result['type'] == 'new') {
    $keys_values = zend_shm_cache_fetch(PERFORMANCE_ZEND_KEYS);
    if ($keys_values === FALSE) {
      $keys_values = array();
    }
    $keys_values[$key] = 1;
    zend_shm_cache_store(PERFORMANCE_ZEND_KEYS, $keys_values, CACHE_PERMANENT);
  }
  zend_shm_cache_store($key, $result['data'], CACHE_PERMANENT);
}