Setup Locust telemetry via CSV
Export test results to CSV
locust --headless --users 2 -t 3m --spawn-rate 1 -H http://my-site.io --csv results/results -f test.pyimport locust.stats
locust.stats.CSV_STATS_INTERVAL_SEC = 30Preprocess the CSV file
#!/bin/bash
cd "$(dirname "$0")"
test_csv=results/results_stats_history.csv
echo 'Formatting locust test'
tr -d '\r' < $test_csv > temp && mv temp $test_csv
sed -i '/,N\/A/d' $test_csv # remove lines without metrics
sed -i '1s/$/,COMPONENT/' $test_csv # add component header
sed -i '2,$s/$/,application/' $test_csv # add component value
awk -F, 'NR>1 { $1=strftime("%Y-%m-%d %H:%M:%S", $1); print } NR==1 { print }' OFS=, $test_csv > temp && mv temp $test_csv # format timestamp
echo 'Locust test formatted'Setup the Telemetry instance
Explore the results

Appendix
Last updated
Was this helpful?