/**
  * @param EntityManager $em
  * @param bool $doCache
  * @param Cache|null $cache
  * @param CacheHitsContainer|null $hitsContainer
  * @return DbCacheableExecutor|DbExecutor
  */
 public static function build(EntityManagerInterface $em, $doCache = false, Cache $cache = null, CacheHitsContainer $hitsContainer = null)
 {
     if (!$cache) {
         return new DbExecutor($em);
     }
     try {
         $stats = $cache->getStats();
         if (isset($stats[Cache::STATS_UPTIME]) && !$stats[Cache::STATS_UPTIME]) {
             throw new \Exception('cache down');
         }
     } catch (\Exception $e) {
         return new DbExecutor($em);
     }
     if ($doCache) {
         return new DbCacheableExecutor($em, $cache, $hitsContainer);
     }
     return new DbExecutor($em);
 }
 public function getStats()
 {
     return $this->cache->getStats();
 }
 public function getStats()
 {
     return $this->getEncryptionStats($this->decorated->getStats() ?: []);
 }
Esempio n. 4
0
 public function getStats()
 {
     return self::$cache->getStats();
 }
 /**
  * Retrieves cached information from the data store.
  *
  * The server's statistics array has the following values:
  *
  * - <b>hits</b>
  * Number of keys that have been requested and found present.
  *
  * - <b>misses</b>
  * Number of items that have been requested and not found.
  *
  * - <b>uptime</b>
  * Time that the server is running.
  *
  * - <b>memory_usage</b>
  * Memory used by this server to store items.
  *
  * - <b>memory_available</b>
  * Memory allowed to use for storage.
  *
  * @since 2.2
  *
  * @return array|null An associative array with server's statistics if available, NULL otherwise.
  */
 public function getStats()
 {
     return $this->doctrineCache->getStats();
 }
Esempio n. 6
0
 /**
  * Retrieves cached information from the data store.
  *
  * The server's statistics array has the following values:
  *
  * - <b>hits</b>
  * Number of keys that have been requested and found present.
  *
  * - <b>misses</b>
  * Number of items that have been requested and not found.
  *
  * - <b>uptime</b>
  * Time that the server is running.
  *
  * - <b>memory_usage</b>
  * Memory used by this server to store items.
  *
  * - <b>memory_available</b>
  * Memory allowed to use for storage.
  *
  * @since 2.2
  *
  * @return array|null An associative array with server's statistics if available, NULL otherwise.
  */
 public function getStats()
 {
     return $this->CacheDriver->getStats();
 }
Esempio n. 7
0
 /**
  * @return array|null
  */
 public function getStats()
 {
     return $this->cacheProvider->getStats();
 }