wip
This commit is contained in:
parent
c0713dc9f0
commit
201efdd0ca
@ -6,6 +6,7 @@ import os
|
|||||||
import csv
|
import csv
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
import time
|
||||||
|
import argparse
|
||||||
|
|
||||||
class BenchmarkRunner:
|
class BenchmarkRunner:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -69,13 +70,17 @@ class BenchmarkRunner:
|
|||||||
raise Exception(f"Unknown benchmark: {benchmark_name}")
|
raise Exception(f"Unknown benchmark: {benchmark_name}")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
pass
|
parser = argparse.ArgumentParser(description='Run GPS benchmark tests.')
|
||||||
|
parser.add_argument('--host', type=str, required=True, help='Host URL')
|
||||||
|
parser.add_argument('--method', type=str, required=True, choices=['route', 'table', 'match', 'nearest', 'trip'], help='Benchmark method')
|
||||||
|
parser.add_argument('--num_requests', type=int, required=True, help='Number of requests to perform')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
random.seed(42)
|
random.seed(42)
|
||||||
|
|
||||||
runner = BenchmarkRunner()
|
runner = BenchmarkRunner()
|
||||||
host = "http://localhost:5000"
|
times = runner.run(args.method, args.host, args.num_requests)
|
||||||
times = runner.run('route', host, 10000)
|
|
||||||
|
|
||||||
print(f'Total: {np.sum(times)}')
|
print(f'Total: {np.sum(times)}')
|
||||||
print(f"Min time: {np.min(times)}")
|
print(f"Min time: {np.min(times)}")
|
||||||
|
@ -60,8 +60,9 @@ function run_benchmarks_for_folder {
|
|||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
python3 $LOCUSTFILE_FOLDER/scripts/ci/e2e_benchmark.py > $RESULTS_FOLDER/e2e_$ALGORITHM.bench
|
for METHOD in route table nearest trip match; do
|
||||||
|
python3 $LOCUSTFILE_FOLDER/scripts/ci/e2e_benchmark.py --host http://localhost:5000 --method $METHOD --num_requests 10000 > $RESULTS_FOLDER/e2e_${METHOD}_${ALGORITHM}.bench
|
||||||
|
done
|
||||||
|
|
||||||
kill -0 $OSRM_ROUTED_PID
|
kill -0 $OSRM_ROUTED_PID
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user