function OpenTelemetryFrontPagePerformanceTest::testFrontPageCoolCache
Same name and namespace in other branches
- 10 core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php \Drupal\Tests\demo_umami\FunctionalJavascript\OpenTelemetryFrontPagePerformanceTest::testFrontPageCoolCache()
- 11.x core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php \Drupal\Tests\demo_umami\FunctionalJavascript\OpenTelemetryFrontPagePerformanceTest::testFrontPageCoolCache()
Logs front page tracing data with a lukewarm cache.
Cool here means that 'global' site caches are warm but anything specific to the front page is cold.
1 call to OpenTelemetryFrontPagePerformanceTest::testFrontPageCoolCache()
- OpenTelemetryFrontPagePerformanceTest::testFrontPagePerformance in core/
profiles/ demo_umami/ tests/ src/ FunctionalJavascript/ OpenTelemetryFrontPagePerformanceTest.php - Tests performance of the Umami demo front page.
File
-
core/
profiles/ demo_umami/ tests/ src/ FunctionalJavascript/ OpenTelemetryFrontPagePerformanceTest.php, line 113
Class
- OpenTelemetryFrontPagePerformanceTest
- Tests demo_umami profile performance.
Namespace
Drupal\Tests\demo_umami\FunctionalJavascriptCode
protected function testFrontPageCoolCache() : void {
// First of all visit the front page to ensure the image style exists.
$this->drupalGet('<front>');
sleep(2);
$this->clearCaches();
// Now visit a different page to warm non-route-specific caches.
$this->drupalGet('user/login');
$performance_data = $this->collectPerformanceData(function () {
$this->drupalGet('<front>');
}, 'umamiFrontPageCoolCache');
$expected = [
'QueryCount' => 61,
'CacheGetCount' => 178,
'CacheSetCount' => 74,
'CacheDeleteCount' => 0,
'CacheTagInvalidationCount' => 0,
'CacheTagLookupQueryCount' => 23,
'ScriptCount' => 1,
'ScriptBytes' => 12000,
'StylesheetCount' => 2,
'StylesheetBytes' => 38850,
];
$this->assertMetrics($expected, $performance_data);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.