You are here

function performance_get_data_memcache in Performance Logging and Monitoring 7

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

Helper function to get data from memcache.

Parameters

$timestamp unix timestamp to start fetching data from:

Return value

array of fetched data

See also

performance_data_stores()

File

./performance.module, line 645
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_get_data_memcache($timestamp = 0) {
  $data_list = array();
  if ($keys_cache = cache_get(PERFORMANCE_KEY, PERFORMANCE_MEMCACHE_BIN)) {
    if ($keys_cache->data) {
      foreach ($keys_cache->data as $key => $v) {
        $cache = cache_get($key, PERFORMANCE_MEMCACHE_BIN);
        if ($cache->created >= $timestamp) {
          $data_list[] = $cache->data;
        }
      }
    }
  }
  return $data_list;
}