You are here

public function CacheDataCollector::registerCacheMiss in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/DataCollector/CacheDataCollector.php \Drupal\webprofiler\DataCollector\CacheDataCollector::registerCacheMiss()
  2. 8 webprofiler/src/DataCollector/CacheDataCollector.php \Drupal\webprofiler\DataCollector\CacheDataCollector::registerCacheMiss()
  3. 8.2 webprofiler/src/DataCollector/CacheDataCollector.php \Drupal\webprofiler\DataCollector\CacheDataCollector::registerCacheMiss()

Registers a cache get on a specific cache bin.

Parameters

$bin:

$cid:

File

webprofiler/src/DataCollector/CacheDataCollector.php, line 61

Class

CacheDataCollector
Collects the used cache bins and cache CIDs.

Namespace

Drupal\webprofiler\DataCollector

Code

public function registerCacheMiss($bin, $cid) {
  $current = isset($this->data['cache'][$bin][$cid]) ? $this->data['cache'][$bin][$cid] : NULL;
  if (!$current) {
    $current = new \StdClass();
    $current->{CacheDataCollector::WEBPROFILER_CACHE_HIT} = 0;
    $current->{CacheDataCollector::WEBPROFILER_CACHE_MISS} = 0;
    $this->data['cache'][$bin][$cid] = $current;
  }
  $current->{CacheDataCollector::WEBPROFILER_CACHE_MISS}++;
  $this->data['total'][CacheDataCollector::WEBPROFILER_CACHE_MISS]++;
}