You are here

protected function CouchbaseCache::doGetStats in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php \Doctrine\Common\Cache\CouchbaseCache::doGetStats()

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

vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php, line 106

Class

CouchbaseCache
Couchbase cache provider.

Namespace

Doctrine\Common\Cache

Code

protected function doGetStats() {
  $stats = $this->couchbase
    ->getStats();
  $servers = $this->couchbase
    ->getServers();
  $server = explode(":", $servers[0]);
  $key = $server[0] . ":" . "11210";
  $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'],
  );
}