You are here

protected function MemcachedCache::doGetStats in Plug 7

Retrieves cached information from the data store.

@since 2.2

Return value

array|null An associative array with server's statistics if available, NULL otherwise.

Overrides CacheProvider::doGetStats

File

lib/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php, line 118

Class

MemcachedCache
Memcached cache provider.

Namespace

Doctrine\Common\Cache

Code

protected function doGetStats() {
  $stats = $this->memcached
    ->getStats();
  $servers = $this->memcached
    ->getServerList();
  $key = $servers[0]['host'] . ':' . $servers[0]['port'];
  $stats = $stats[$key];
  return array(
    Cache::STATS_HITS => $stats['get_hits'],
    Cache::STATS_MISSES => $stats['get_misses'],
    Cache::STATS_UPTIME => $stats['uptime'],
    Cache::STATS_MEMORY_USAGE => $stats['bytes'],
    Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'],
  );
}