/**
* Count how often the given event occured, within the current cache-timeframe.
*
* @param SystemEvent $evt
* @throws Exception
*
* @return int The number of equal-hashed events
*/
public function count(SystemEvent $evt)
{
if (empty($evt->hash)) {
throw new Exception("Hash is not expected to be empty!");
}
if ($this->dataStatistics->supported()) {
return $this->dataStatistics->get(self::CACHE_NAMESPACE . $evt->hash, 0);
}
// when APC is not supported, return approx. value
return count($this->findByHash($evt->hash));
}