Visit the site

Visit the site

Organizations Involved

Born as a result of an ongoing collaboration between the Google Chrome team and Tag1 Consulting, Drupal’s performance and scalability are getting a major boost with Gander the open source automated performance testing framework, designed and led by Drupal core release and framework manager Nathaniel Catchpole - catch. The system will greatly benefit the development of the Drupal platform itself and, as an open-source tool, enable end-users of Drupal to integrate performance testing into their DevOps toolchain, delivering a substantial competitive advantage to sites powered by Drupal.

Describe the project (goals, requirements and outcome)

What is Gander

Gander is an open source automated performance testing framework, which has been part of Drupal core since 10.2 and allows us to monitor performance across time and ensure that performance regressions aren't unknowingly re-introduced. Gander isn't limited to core development, so anyone can start using it today!

Learn more about the motivation behind it, it’s history and origins.

Why should I use it

Performance is important, but often overlooked. Experience shows that many organizations neglect performance aspects of their projects until problems pile up to the extent that makes them impossible to ignore. At that point it is often very difficult to reverse the trend due to large technical debt and cultural aspects, which results in months or even years of effort to take the performance of the project back on the right track.

Performance, on the other hand, has a significant and direct impact on the business outcomes. Research shows that even minor performance regressions turn users away, directly resulting in narrower reach and a negative impact on the bottom line.

We already have tools and metrics to reliably measure end user performance experience. Core Web Vitals are becoming an industry standard and anyone can check how their website is performing using tools like PageSpeed Insights and Lighthouse. The main disadvantage of these tools is that we use them retroactively. We would prefer a tool that will detect performance regressions even before it will reach end users.

Gander lets us do exactly that. By incorporating it into existing CI/CD pipelines we ensure that it runs and regularly checks performance of a project during the development cycle. Depending on how it is used it will let us monitor metrics over time and compare them to the baseline (does a change X perform better or worse than the current release, how do releases perform against each other, …) or even fail the automated test suite as soon as one of the important metrics exceeds the threshold that we consider satisfactory.

This allows us to both ensure that the performance of the project improves (or at least does not deteriorate) over time and outright fails when major issues are about to sneak in unnoticed. 

How it can be used

A Gander performance test is an extension of a standard functional test, which will additionally collect the following performance metrics during the page lifecycle:

Back to top
Why Drupal was chosen

The Google Chrome team chose Drupal as one of its key partners for improving web performance because of Drupal's strong foothold on the web, especially among some of the most highly trafficked sites online today.

When the Google Chrome team first approached the Drupal Association about improving the performance of the Open Web, Tag1 was an obvious choice as partner. Tag1 has been and are pioneers in web performance at scale, and have the knowledge and expertise to bring a robust automated performance testing system to Drupal.

Image

Technical Specifications

Drupal version:

Why these modules/theme/distribution were chosen
Back to top

What is Gander?

Gander is a preconfigured Open Telemetry stack relying on Prometheus, Grafana, and Grafana Tempo.

You can use the Gander DDEV add-on to run Drupal core’s OpenTelemetry PHPUnit tests, and immediately see performance metrics and traces in the Grafana dashboard. Additionally, if you already have PHPUnit functional test coverage of your project, you can use PerformanceTestBase to add performance coverage with just a few lines of code.

For more information on the phpunit side of things, see the Drupal core change record.

For more information check the documentation.

Back to top

Prerequisites:

  • Install ddev if you haven't already.
  • Enable ddev on your local Drupal project.
  • Ensure you can already run functional JavaScript tests in the ddev environment. This requires a working chromedriver container as part of your ddev installation. You can run any core functional javascript test without having Gander installed to confirm.

For most use cases, this chrome image should work out of the box: ddev get ddev/ddev-selenium-standalone-chrome

Back to top

Getting started

Add Gander and run Drupal's performance tests via a git clone of Drupal core (assuming composer is used):

  • ddev get tag1consulting/ddev-gander
  • ddev restart
  • ddev ssh
  • cd web/
  • To run a single test three times in order to check the Gander installation, ensure you're in the document root first: for run in 1..3; do ../vendor/bin/phpunit -c core profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php --filter hot; done;
  • To run all OpenTelemetry tests: ../vendor/bin/phpunit -c core --group OpenTelemetry
  • Check the Grafana dashboard via: http://<projectname>.ddev.site:3000/
Back to top