Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!9595
Start taxonomy term admin list page performance test
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
Start taxonomy term admin list page performance test
issue/drupal-3476439:3476439-term-list-performance-test
into
11.x
Overview
8
Commits
14
Pipelines
20
Changes
1
Open
Start taxonomy term admin list page performance test
Marco Villegas
requested to merge
issue/drupal-3476439:3476439-term-list-performance-test
into
11.x
10 months ago
Overview
4
Commits
14
Pipelines
20
Changes
1
Closes
#3476439
0
0
Merge request reports
Compare
11.x
version 18
279cbfad
6 months ago
version 17
a3f97556
6 months ago
version 16
98b825ca
6 months ago
version 15
beac7274
6 months ago
version 14
40d9c08c
6 months ago
version 13
c752ea55
6 months ago
version 12
be4dec99
6 months ago
version 11
2aceabd7
6 months ago
version 10
d231d49f
8 months ago
version 9
90224250
9 months ago
version 8
82584851
9 months ago
version 7
2aef88e1
10 months ago
version 6
06c218fe
10 months ago
version 5
725432dc
10 months ago
version 4
6bc0ea4a
10 months ago
version 3
9ad0e4e8
10 months ago
version 2
61f75ffe
10 months ago
version 1
0b67ab6c
10 months ago
11.x (HEAD)
and
latest version
latest version
e54f7b7f
14 commits,
3 months ago
version 18
279cbfad
15 commits,
6 months ago
version 17
a3f97556
14 commits,
6 months ago
version 16
98b825ca
13 commits,
6 months ago
version 15
beac7274
12 commits,
6 months ago
version 14
40d9c08c
11 commits,
6 months ago
version 13
c752ea55
11 commits,
6 months ago
version 12
be4dec99
10 commits,
6 months ago
version 11
2aceabd7
10 commits,
6 months ago
version 10
d231d49f
10 commits,
8 months ago
version 9
90224250
9 commits,
9 months ago
version 8
82584851
9 commits,
9 months ago
version 7
2aef88e1
8 commits,
10 months ago
version 6
06c218fe
8 commits,
10 months ago
version 5
725432dc
6 commits,
10 months ago
version 4
6bc0ea4a
4 commits,
10 months ago
version 3
9ad0e4e8
3 commits,
10 months ago
version 2
61f75ffe
2 commits,
10 months ago
version 1
0b67ab6c
1 commit,
10 months ago
1 file
+
130
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/profiles/demo_umami/tests/src/FunctionalJavascript/VocabularyAdminPerformanceTest.php
0 → 100644
+
130
−
0
View file @ 212a3fb9
Edit in single-file editor
Open in Web IDE
<?php
declare
(
strict_types
=
1
);
namespace
Drupal\Tests\demo_umami\FunctionalJavascript
;
use
Drupal\block\Entity\Block
;
use
Drupal\Core\Cache\Cache
;
use
Drupal\FunctionalJavascriptTests\PerformanceTestBase
;
/**
* Tests demo_umami profile performance on vocabulary admin page.
*
* @group OpenTelemetry
* @requires extension apcu
*/
class
VocabularyAdminPerformanceTest
extends
PerformanceTestBase
{
/**
* {@inheritdoc}
*/
protected
$profile
=
'demo_umami'
;
/**
* {@inheritdoc}
*/
protected
function
setUp
():
void
{
parent
::
setUp
();
$this
->
drupalLogin
(
$this
->
drupalCreateUser
([
'administer taxonomy'
,
]));
// Remove the block showing tags terms on the footer, to be able to not
// load terms there by default on every page directly.
$block
=
$this
->
container
->
get
(
'entity_type.manager'
)
->
getStorage
(
'block'
)
->
load
(
'umami_views_block__recipe_collections_block'
);
$this
->
assertTrue
(
$block
instanceof
Block
);
$block
->
delete
();
}
/**
* Test vocabulary admin page performance with various cache permutations.
*/
public
function
testPerformance
():
void
{
$this
->
testColdCache
();
$this
->
testHotCache
();
$this
->
testCoolCache
();
}
/**
* Logs vocabulary admin page tracing data with a cold cache.
*/
protected
function
testColdCache
():
void
{
// @todo Chromedriver doesn't collect tracing performance logs for the very
// first request in a test, so warm it up.
// https://www.drupal.org/project/drupal/issues/3379750
$this
->
drupalGet
(
'user/login'
);
$this
->
rebuildAll
();
$this
->
collectPerformanceData
(
function
()
{
$this
->
drupalGet
(
'admin/structure/taxonomy/manage/tags/overview'
);
},
'umamiVocabularyAdminPageColdCache'
);
$this
->
assertTermInVocabularyAdminPage
();
}
/**
* Logs vocabulary admin page tracing data with a hot cache.
*
* Hot here means that all possible caches are warmed.
*/
protected
function
testHotCache
():
void
{
// Request the page twice so that asset aggregates are definitely cached in
// the browser cache.
$this
->
drupalGet
(
'admin/structure/taxonomy/manage/tags/overview'
);
$this
->
drupalGet
(
'admin/structure/taxonomy/manage/tags/overview'
);
$performance_data
=
$this
->
collectPerformanceData
(
function
()
{
$this
->
drupalGet
(
'admin/structure/taxonomy/manage/tags/overview'
);
},
'umamiVocabularyAdminPageHotCache'
);
$expected
=
[
'queryCount'
=>
12
,
'cacheGetCount'
=>
115
,
'cacheSetCount'
=>
0
,
'cacheDeleteCount'
=>
0
,
'cacheTagChecksumCount'
=>
0
,
'cacheTagIsValidCount'
=>
72
,
];
$this
->
assertTermInVocabularyAdminPage
();
$this
->
assertMetrics
(
$expected
,
$performance_data
);
}
/**
* Logs vocabulary admin page 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.
*/
protected
function
testCoolCache
():
void
{
// Visit a page without the tags terms loaded.
$this
->
drupalGet
(
'user/login'
);
$this
->
clearCaches
();
// Now visit it post cache rebuild to warm non-route-specific
// caches.
$this
->
drupalGet
(
'user/login'
);
$this
->
collectPerformanceData
(
function
()
{
$this
->
drupalGet
(
'admin/structure/taxonomy/manage/tags/overview'
);
},
'umamiVocabularyAdminPageCoolCache'
);
$this
->
assertTermInVocabularyAdminPage
();
}
/**
* Helper to find a known term in the list post page request.
*
* @param string $term_name
* Term to find.
*/
protected
function
assertTermInVocabularyAdminPage
(
string
$term_name
=
'Baked'
):
void
{
$this
->
assertSession
()
->
elementTextContains
(
'xpath'
,
'//table[@id="taxonomy"]'
,
$term_name
);
}
/**
* Clears all cache bins.
*/
protected
function
clearCaches
():
void
{
foreach
(
Cache
::
getBins
()
as
$bin
)
{
$bin
->
deleteAll
();
}
}
}
Loading