function OpenTelemetryPerformanceTest::testNodePageCoolCache

Same name and namespace in other branches
  1. 11.x core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryPerformanceTest.php \Drupal\Tests\demo_umami\FunctionalJavascript\OpenTelemetryPerformanceTest::testNodePageCoolCache()

Logs node/1 tracing data with a cool cache.

Cool here means that 'global' site caches are warm but anything specific to the route or path is cold.

1 call to OpenTelemetryPerformanceTest::testNodePageCoolCache()
OpenTelemetryPerformanceTest::testUmamiPerformance in core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryPerformanceTest.php
Test performance of various with various cache permutations.

File

core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryPerformanceTest.php, line 94

Class

OpenTelemetryPerformanceTest
Tests demo_umami profile performance.

Namespace

Drupal\Tests\demo_umami\FunctionalJavascript

Code

protected function testNodePageCoolCache() : void {
  // First of all visit the node page to ensure the image style exists.
  $this->drupalGet('node/1');
  $this->clearCaches();
  // Now visit a non-node page to warm non-route-specific caches.
  $this->drupalGet('user/login');
  $performance_data = $this->collectPerformanceData(function () {
    $this->drupalGet('node/1');
  }, 'umamiNodePageCoolCache');
  $this->assertSession()
    ->pageTextContains('quiche');
  $this->assertMetricsByName('umamiNodePageCoolCache', $performance_data);
}

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