This commit is contained in:
Siarhei Fedartsou 2024-05-26 13:23:51 +02:00
parent aee8f0febe
commit c0b8be4676
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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
}