function CacheTagsChecksumDecorator::getCurrentChecksum

Same name in other branches
  1. 10 core/modules/system/tests/modules/performance_test/src/Cache/CacheTagsChecksumDecorator.php \Drupal\performance_test\Cache\CacheTagsChecksumDecorator::getCurrentChecksum()

Overrides CacheTagsChecksumInterface::getCurrentChecksum

File

core/modules/system/tests/modules/performance_test/src/Cache/CacheTagsChecksumDecorator.php, line 21

Class

CacheTagsChecksumDecorator
Wraps an existing cache tags checksum invalidator to track calls separately.

Namespace

Drupal\performance_test\Cache

Code

public function getCurrentChecksum(array $tags) {
    // If there are no cache tags, there is no checksum to get and the decorated
    // method will be a no-op, so don't log anything.
    if (empty($tags)) {
        return $this->checksumInvalidator
            ->getCurrentChecksum($tags);
    }
    $start = microtime(TRUE);
    $return = $this->checksumInvalidator
        ->getCurrentChecksum($tags);
    $stop = microtime(TRUE);
    $this->logCacheTagOperation($tags, $start, $stop, CacheTagOperation::GetCurrentChecksum);
    return $return;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.