This repository stores performance benchmarking scripts for apps on CommCareHQ, based on LocustIO.
$ pip install -r requirements.txt
The following environment variables are required for mobile worker performance testing:
- CCHQ_DOMAIN: The test domain name
- CCHQ_APP_ID: The ID of the test app
- CCHQ_USERNAME: The username of a CommCare HQ mobile worker who is a member of the test domain. e.g. "j.doe@test-domain.commcarehq.org"
- CCHQ_PASSWORD: Their password
The following are used for formplayer performance testing:
- CCHQ_DOMAIN: The test domain name
- CCHQ_APP_ID: The ID of the test app
- CCHQ_USERNAME: The username of a web user
- CCHQ_PASSWORD: Their password
- CCHQ_LOGIN_AS (optional): The mobile worker that the web user should log in as. Please exclude the domain name, e.g. "j.doe"
You can use the Locust environment variable LOCUST_HOST
to set the
base URL of the CommCare HQ instance, e.g.
LOCUST_HOST=https://staging.commcarehq.org
. Alternatively, use
the -H
or --host
command line option.
Environment variables are stored in config.env
, which uses the same
format as /etc/environment
or a Docker Compose env_file.
Basic usage, for a single test user:
$ export $(grep -v '^#' config.env | xargs) $ locust -f locustfiles/form_submission.py --headless -u 1 -r 1
Leave off --headless
to view results in the Locust web UI. See
docs for options to set number of users, run time, etc.