function PerformanceTestTrait::getMetrics

Get metrics from a performance data value object.

Parameters

\Drupal\Tests\PerformanceData $performance_data: An instance of the performance data value object.

Return value

array An array of metrics.

File

core/tests/Drupal/Tests/PerformanceTestTrait.php, line 686

Class

PerformanceTestTrait
Provides various methods to aid in collecting performance data during tests.

Namespace

Drupal\Tests

Code

protected function getMetrics(PerformanceData $performance_data) : array {
    return [
        'StylesheetCount' => $performance_data->getStylesheetCount(),
        'ScriptCount' => $performance_data->getScriptCount(),
        'StylesheetBytes' => $performance_data->getStylesheetBytes(),
        'ScriptBytes' => $performance_data->getScriptBytes(),
        'QueryCount' => $performance_data->getQueryCount(),
        'CacheGetCount' => $performance_data->getCacheGetCount(),
        'CacheSetCount' => $performance_data->getCacheSetCount(),
        'CacheDeleteCount' => $performance_data->getCacheDeleteCount(),
        'CacheTagChecksumCount' => $performance_data->getCacheTagChecksumCount(),
        'CacheTagIsValidCount' => $performance_data->getCacheTagIsValidCount(),
        'CacheTagInvalidationCount' => $performance_data->getCacheTagInvalidationCount(),
    ];
}

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