You are here

public function PerformanceTestRecorder::getCount in Drupal 9

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Test/PerformanceTestRecorder.php \Drupal\Core\Test\PerformanceTestRecorder::getCount()

File

core/lib/Drupal/Core/Test/PerformanceTestRecorder.php, line 45

Class

PerformanceTestRecorder
Records the number of times specific events occur.

Namespace

Drupal\Core\Test

Code

public function getCount(string $type, string $name) : int {
  $count = 0;
  if ($this->state) {
    $record = $this->state
      ->get('drupal.performance_test_recorder', []);
    $count += $record[$type][$name] ?? 0;
  }
  $count += self::$record[$type][$name] ?? 0;
  return $count;
}