diff --git a/scripts/ci/locustfile.py b/scripts/ci/locustfile.py index 3cf60f28b..b04064723 100644 --- a/scripts/ci/locustfile.py +++ b/scripts/ci/locustfile.py @@ -70,5 +70,4 @@ class OSRMTasks(TaskSet): class OSRMUser(HttpUser): tasks = [OSRMTasks] - # random wait time between requests to not load server for 100% wait_time = constant(0.05) diff --git a/scripts/ci/run_benchmarks.sh b/scripts/ci/run_benchmarks.sh index 3f20cf5f9..9aaf026c7 100755 --- a/scripts/ci/run_benchmarks.sh +++ b/scripts/ci/run_benchmarks.sh @@ -6,6 +6,7 @@ function run_benchmarks_for_folder { FOLDER=$1 RESULTS_FOLDER=$2 + LOCUSTFILE_FOLDER=$3 mkdir -p $RESULTS_FOLDER @@ -28,32 +29,31 @@ function run_benchmarks_for_folder { $BINARIES_FOLDER/osrm-customize $FOLDER/data.osrm $BINARIES_FOLDER/osrm-contract $FOLDER/data.osrm - if [ -f "$FOLDER/scripts/ci/locustfile.py" ]; then - for ALGORITHM in mld ch; do - $BINARIES_FOLDER/osrm-routed --algorithm $ALGORITHM $FOLDER/data.osrm & - OSRM_ROUTED_PID=$! + for ALGORITHM in mld ch; do + $BINARIES_FOLDER/osrm-routed --algorithm $ALGORITHM $FOLDER/data.osrm & + OSRM_ROUTED_PID=$! - # wait for osrm-routed to start - curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" - locust -f $FOLDER/../pr/scripts/ci/locustfile.py \ - --headless \ - --processes -1 \ - --users 10 \ - --spawn-rate 1 \ - --host http://localhost:5000 \ - --run-time 1m \ - --csv=locust_results_$ALGORITHM \ - --loglevel ERROR + # wait for osrm-routed to start + curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" + locust -f $LOCUSTFILE_FOLDER/scripts/ci/locustfile.py \ + --headless \ + --processes -1 \ + --users 10 \ + --spawn-rate 1 \ + --host http://localhost:5000 \ + --run-time 1m \ + --csv=locust_results_$ALGORITHM \ + --loglevel ERROR - python3 $FOLDER/scripts/ci/process_locust_benchmark_results.py locust_results_$ALGORITHM $ALGORITHM $RESULTS_FOLDER + python3 $FOLDER/scripts/ci/process_locust_benchmark_results.py locust_results_$ALGORITHM $ALGORITHM $RESULTS_FOLDER - kill -0 $OSRM_ROUTED_PID - done - fi + kill -0 $OSRM_ROUTED_PID + done + } -run_benchmarks_for_folder $1 "${1}_results" -run_benchmarks_for_folder $2 "${2}_results" +run_benchmarks_for_folder $1 "${1}_results" $2 +run_benchmarks_for_folder $2 "${2}_results" $2