Load Testing of covid-ht Instances¶
covid-ht includes scripts to estimate the instance capacity and to simulate
usage scenarios in order to fulfill demand.
Those scripts are meant to be run with locust and
located in the locustfiles/ directory.
Installation¶
Install the load testing requirements:
> (activate your virtualenv)
> pip install -r requirements_load_testing.txt
Configuration¶
If the Example Data is not available, you will have to provide a user and its
credentials by setting the counterintuitively named environment variables
CHTLT_USER_USERNAME, CHTLT_USER_PASSWORD and CHTLT_USER_AUTH_TOKEN.
Otherwise the example users will be used for the requests.
Estimating Instance Capacity¶
Make sure that your instance is running (i.e. already deployed or with
./manage.py runserver)From the base dir of the distribution, run:
> locust -f locustfiles/<load_testing_file>.py
Four tests are provided:
api_classifyfor testing classification via the REST API,
api_data_inputfor testing data input via the REST API,
classifyfor testing classification via the HTML front-end,
data_inputfor testing data input via the HTML front-end.
Each test will stress-test the instance in its particular way, giving an estimate of the instance capacity to fulfill demand.
Details of the tests are found in their respective files.
Simulating Usage Scenarions¶
Two different processes are provided for simulating usage scenarios:
doctorssimulate doctors attending patients,
inputterssimulate data inputters inputting hemogram results.
Details of the processes are found in their respective files.
For running the scenario - with your instance running - from a shell run:
> locust -f locustfiles/doctors.py
and from another shell:
> locust -f locustfiles/inputters.py --web-port 8090
The processes are meant to be ran simultaneously, you can add more processes simulating the classification requests incoming from the network or other local sources
Notes¶
Classification performance depends on the Current Classifier selected for the instance.
Data input test will generate actual data in your instance, which can be safely removed with the
example_datacommand if it was created with the example users (see Managing Example Data).