示例#1
0
 /**
  * Store cache set information
  *
  * @param $event
  */
 public function onCacheSet(CacheEvent $event)
 {
     $key = $event->getCacheabledata()->getHashKey();
     if (isset(self::$collectedData[$key]['set'])) {
         self::$collectedData[$key]['set']++;
     } else {
         self::$collectedData[$key]['set'] = 1;
     }
     self::$collectedData[$key]['size'] = strlen($event->getCacheabledata()->getDataForCache());
 }
示例#2
0
 /**
  * Store cache remove information
  *
  * @param $event
  */
 public function onCacheRemove(CacheEvent $event)
 {
     $key = $event->getCacheabledata()->getHashKey();
     if (isset(self::$data[$key]['remove'])) {
         self::$data[$key]['remove']++;
     } else {
         self::$data[$key]['remove'] = 1;
     }
     self::$removeCount++;
 }
示例#3
0
 /**
  * Remove entity cache
  *
  * @param CacheEvent $event
  *
  * @return void
  */
 public function removeEntityCache(CacheEvent $event)
 {
     $this->cache->remove($event->getCacheableData());
 }