You are here

function performance_clear_memcache in Performance Logging and Monitoring 7

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

Clear Memcache confirm form submit handler.

File

./performance.module, line 683
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_clear_memcache() {

  // We have to iterate over all entries and delete them, reaching down
  // the API stack and calling dmemcache_delete directly.
  // This is suboptimal, but there is no other alternative.
  if ($keys_cache = cache_get(PERFORMANCE_KEY, PERFORMANCE_MEMCACHE_BIN)) {
    if ($keys_cache->data) {
      foreach ($keys_cache->data as $key => $v) {
        dmemcache_delete($key, PERFORMANCE_MEMCACHE_BIN);
      }
      dmemcache_delete(PERFORMANCE_KEY, PERFORMANCE_MEMCACHE_BIN);
    }
  }
}