diff --git a/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php b/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
index 5a25d2a71eec888024ec9a22443408a8cd894c13..676eaf755e51d42513bdfba54892ba6d9af548ff 100644
--- a/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
+++ b/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
@@ -68,20 +68,23 @@ public function testLogin(): void {
       'SELECT "roles_target_id" FROM "user__roles" WHERE "entity_id" = "2"',
       'SELECT "name", "value" FROM "key_value" WHERE "name" IN ( "theme:stark" ) AND "collection" = "config.entity.key_store.block"',
     ];
-
     $recorded_queries = $performance_data->getQueries();
     $this->assertSame($expected_queries, $recorded_queries);
-    $this->assertSame(4, $performance_data->getQueryCount());
-    $this->assertSame(61, $performance_data->getCacheGetCount());
-    $this->assertSame(2, $performance_data->getCacheSetCount());
-    $this->assertSame(0, $performance_data->getCacheDeleteCount());
-    $this->assertSame(2, $performance_data->getCacheTagChecksumCount());
-    $this->assertSame(29, $performance_data->getCacheTagIsValidCount());
-    $this->assertSame(0, $performance_data->getCacheTagInvalidationCount());
-    $this->assertSame(1, $performance_data->getStyleSheetCount());
-    $this->assertSame(2, $performance_data->getScriptCount());
-    $this->assertLessThan(90200, $performance_data->getStylesheetBytes());
-    $this->assertLessThan(220000, $performance_data->getScriptBytes());
+
+    $expected = [
+      'QueryCount' => 4,
+      'CacheGetCount' => 61,
+      'CacheSetCount' => 2,
+      'CacheDeleteCount' => 0,
+      'CacheTagChecksumCount' => 2,
+      'CacheTagIsValidCount' => 29,
+      'CacheTagInvalidationCount' => 0,
+      'ScriptCount' => 2,
+      'ScriptBytes' => 220000,
+      'StylesheetCount' => 1,
+      'StylesheetBytes' => 90200,
+    ];
+    $this->assertMetrics($expected, $performance_data);
 
     // Check that the navigation toolbar is cached without any high-cardinality
     // cache contexts (user, route, query parameters etc.).