Setup Locust telemetry via CSV
Locust (https://locust.io/) is a popular Python-based load-testing tool. If you use Locust to run your load tests you might want to follow these guidelines to import its metrics (throughput, errors, and response time) using the CSV file telemetry provider.
Export test results to CSV
Locust can export the results of a test in a variety of formats, including CSV files.
To generate a csv file from locust add the --csv results/results
argument to the locust command line used to invoke the test as in this example.
This will make locust generate some CSV files in the results
folder; we are interested in the file name results_stats_history.csv
which contains some time-series with the core performance metrics.
We also suggest adding the following lines at the beginning of your locust file to reduce the sampling frequency reported in the CSV from the default of 1 second to 30 seconds as described here.
Preprocess the CSV file
In order to import the CSV into Akamas we still need to do a bit of pre-processing in order to:
Update the timestamp in a more friendly format
Add a column with the name of the Akamas component
This can be done by running the following script, make sure to change application
on line 10 with the name of your Web Application component.
You can easily add this as an operator to the akamas workflow so that it gets executed at the end of every test run or integrated into the script that launches your locus test.
Setup the Telemetry instance
Now you can create a telemetry instance such as the following one to import the metrics.
Save this snippet in a YAML file by editing the following sections:
Host, username, and authentication to connect to the instance where the CSV file is hosted (lines 7-11)
remotefilePattern with the path to the CSV file to load on the instance
Explore the results
Now you can use the imported metrics in your study goal and constraints and explore them from the UI.
Appendix
Here you can find a collection of sample artifacts to be used to setup a workflow that runs the test and prepares the csv file using the toolbox as the target host.
Last updated