From c0b8be4676e40bf241e2677fd901aa7a983daaba Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 26 May 2024 13:23:51 +0200 Subject: [PATCH] wip --- locustfile.py | 6 ++---- scripts/ci/run_benchmarks.sh | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locustfile.py b/locustfile.py index 0999f69bd..c833bce7d 100644 --- a/locustfile.py +++ b/locustfile.py @@ -3,13 +3,11 @@ from locust import HttpUser, TaskSet, task, between class OSRMTasks(TaskSet): @task def get_route(self): - # Define the coordinates for the route start = "13.388860,52.517037" end = "13.397634,52.529407" - # Make a request to the OSRM route service - self.client.get(f"/route/v1/driving/{start};{end}?overview=false") + self.client.get(f"/route/v1/driving/{start};{end}?overview=full&steps=true") -class WebsiteUser(HttpUser): +class OSRMUser(HttpUser): tasks = [OSRMTasks] wait_time = between(1, 5) diff --git a/scripts/ci/run_benchmarks.sh b/scripts/ci/run_benchmarks.sh index ea55f23df..99b8a5bc4 100755 --- a/scripts/ci/run_benchmarks.sh +++ b/scripts/ci/run_benchmarks.sh @@ -30,7 +30,9 @@ function run_benchmarks_for_folder { # TODO: save results 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.py --headless --users 10 --spawn-rate 1 --host http://localhost:5000 --run-time 1m + locust -f locustfile.py --headless --users 10 --spawn-rate 1 --host http://localhost:5000 --run-time 1m --csv=results + + cat results_distribution.csv kill -0 $OSRM_ROUTED_PID }