wip
This commit is contained in:
parent
853e06b738
commit
71cb9d7bcd
@ -30,22 +30,22 @@ class OSRMTasks(TaskSet):
|
||||
|
||||
self.client.get(f"/route/v1/driving/{start_coord};{end_coord}?overview=full&steps=true", name="driving")
|
||||
|
||||
# @task
|
||||
# def get_table(self):
|
||||
# num_coords = random.randint(3, 50)
|
||||
# selected_coords = random.sample(self.coordinates, num_coords)
|
||||
# coords_str = ";".join([f"{coord[1]:.6f},{coord[0]:.6f}" for coord in selected_coords])
|
||||
@task
|
||||
def get_table(self):
|
||||
num_coords = random.randint(3, 50)
|
||||
selected_coords = random.sample(self.coordinates, num_coords)
|
||||
coords_str = ";".join([f"{coord[1]:.6f},{coord[0]:.6f}" for coord in selected_coords])
|
||||
|
||||
# self.client.get(f"/table/v1/driving/{coords_str}", name="table")
|
||||
self.client.get(f"/table/v1/driving/{coords_str}", name="table")
|
||||
|
||||
# @task
|
||||
# def get_match(self):
|
||||
# num_coords = random.randint(3, 50)
|
||||
# track_id = random.choice(self.track_ids)
|
||||
# track_coords = self.tracks[track_id][:num_coords]
|
||||
# coords_str = ";".join([f"{coord[1]:.6f},{coord[0]:.6f}" for coord in track_coords])
|
||||
@task
|
||||
def get_match(self):
|
||||
num_coords = random.randint(3, 50)
|
||||
track_id = random.choice(self.track_ids)
|
||||
track_coords = self.tracks[track_id][:num_coords]
|
||||
coords_str = ";".join([f"{coord[1]:.6f},{coord[0]:.6f}" for coord in track_coords])
|
||||
|
||||
# self.client.get(f"/match/v1/driving/{coords_str}?steps=true", name="match")
|
||||
self.client.get(f"/match/v1/driving/{coords_str}?steps=true", name="match")
|
||||
|
||||
@task
|
||||
def get_nearest(self):
|
||||
|
@ -24,15 +24,15 @@ def main(locust_csv_base_name, prefix, output_folder):
|
||||
|
||||
statistics = f'''
|
||||
requests: {row['Request Count']}
|
||||
req/s: {row['Requests/s']}req/s
|
||||
fail/s: {row['Failures/s']}fail/s
|
||||
avg: {row['Average Response Time']}ms
|
||||
50%: {row['50%']}
|
||||
req/s: {float(row['Requests/s']):.3f}req/s
|
||||
fail/s: {float(row['Failures/s']):.3f}fail/s
|
||||
avg: {float(row['Average Response Time']):.3f}ms
|
||||
50%: {row['50%']}ms
|
||||
75%: {row['75%']}ms
|
||||
95%: {row['95%']}ms
|
||||
98%: {row['98%']}ms
|
||||
99%: {row['99%']}ms
|
||||
max: {row['Max Response Time']}ms
|
||||
max: {float(row['Max Response Time']):.3f}ms
|
||||
'''
|
||||
with open(f"{output_folder}/{prefix}_{name}.bench", 'w') as f:
|
||||
print(f"Writing statistics to {output_folder}/{prefix}_{name}.bench")
|
||||
|
Loading…
Reference in New Issue
Block a user