function OpenTelemetryNodePagePerformanceTest::testNodePageWarmCache

Same name in other branches
  1. 10 core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php \Drupal\Tests\demo_umami\FunctionalJavascript\OpenTelemetryNodePagePerformanceTest::testNodePageWarmCache()

Log node/1 tracing data with a warm cache.

Warm here means that 'global' site caches and route-specific caches are warm but caches specific to this particular node/path are not.

1 call to OpenTelemetryNodePagePerformanceTest::testNodePageWarmCache()
OpenTelemetryNodePagePerformanceTest::testNodePage in core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
Test canonical node page performance with various cache permutations.

File

core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php, line 105

Class

OpenTelemetryNodePagePerformanceTest
Tests demo_umami profile performance.

Namespace

Drupal\Tests\demo_umami\FunctionalJavascript

Code

protected function testNodePageWarmCache() : void {
    // First of all visit the node page to ensure the image style exists.
    $this->drupalGet('node/1');
    $this->clearCaches();
    // Now visit a different node page to warm non-path-specific caches.
    $this->drupalGet('node/2');
    $this->collectPerformanceData(function () {
        $this->drupalGet('node/1');
    }, 'umamiNodePageWarmCache');
    $this->assertSession()
        ->pageTextContains('quiche');
}

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