loadtest

Categories

Component ID

168727

Component name

loadtest

Component type

module

Component security advisory coverage

not-covered

Downloads

567

Component created

Component changed

Component body

A framework for running and building load tests on a Drupal site.

The goal of this module is to allow site administrators to run benchmarks of there website under various configuration settings to help find bottlenecks and other issues that might be slowing down their site. It also targeted towards developers who wish to design load tests for their own modules.

Use Cases

One of the built in test suites that can be used automatically runs through the list of enabled modules and runs load tests on each module individually. At the end of the test run the user can view the duration of each test and will be able to see if it ran significantly slower when any particular module was enabled.

More involved load testing can also be done using pre-configured states. For example, a developer might write a patch against core and want to see what the effect the patch might have on the site load. They can set up a number of states each with different configuration settings and setup a script (maybe using ab2) to run a series of tests against the site and automatically changing the state when each test is done.

Writing load tests

Writing a load test is almost identical to writing a simpletest test. There are two key differences:

  1. a load test class should inherit from DrupalLoadTest, not DrupalTestCase. DrupalLoadTest overrides the test case class to add timing and logging. It also gives allows the developer to add user configurable settings for their load tests.
  2. the load test group needs to be "Load testing"