Skip to content

Commit 406c29f

Browse files
committed
Reformat files
1 parent f8cd5b3 commit 406c29f

File tree

6 files changed

+58
-35
lines changed

6 files changed

+58
-35
lines changed

redis_benchmarks_specification/__builder__/builder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,10 @@ def generate_benchmark_stream_request(
654654
for artifact in build_artifacts:
655655
bin_key = f"zipped:artifacts:{prefix}:{id}:{artifact}.zip"
656656
if artifact == "redisearch.so":
657-
bin_artifact = open(f"{redis_temporary_dir}modules/redisearch/src/bin/linux-x64-release/search-community/{artifact}", "rb").read()
657+
bin_artifact = open(
658+
f"{redis_temporary_dir}modules/redisearch/src/bin/linux-x64-release/search-community/{artifact}",
659+
"rb",
660+
).read()
658661
else:
659662
bin_artifact = open(f"{redis_temporary_dir}src/{artifact}", "rb").read()
660663
bin_artifact_len = len(bytes(bin_artifact))

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,30 +203,31 @@ def run_client_runner_logic(args, project_name, project_name_suffix, project_ver
203203
override_memtier_test_time,
204204
)
205205

206+
206207
def prepare_vector_db_benchmark_parameters(
207-
clientconfig,
208-
full_benchmark_path,
209-
port,
210-
server,
211-
password,
212-
client_mnt_point
208+
clientconfig, full_benchmark_path, port, server, password, client_mnt_point
213209
):
214210
benchmark_command = []
215211
# if port is not None:
216212
# benchmark_command.extend(["REDIS_PORT={}".format(port)])
217213
# if password is not None:
218214
# benchmark_command.extend(["REDIS_AUTH={}".format(password)])
219-
benchmark_command.extend([
220-
full_benchmark_path,
221-
"--host",
222-
f"{server}",
223-
])
215+
benchmark_command.extend(
216+
[
217+
full_benchmark_path,
218+
"--host",
219+
f"{server}",
220+
]
221+
)
224222
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-test")])
225-
benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")])
223+
benchmark_command.extend(
224+
["--datasets", clientconfig.get("datasets", "glove-100-angular")]
225+
)
226226
benchmark_command_str = " ".join(benchmark_command)
227227
benchmark_command_str = f"bash -c 'ITERATIONS=1 {benchmark_command_str} && mv /code/results {client_mnt_point}.'"
228228
return None, benchmark_command_str
229229

230+
230231
def prepare_memtier_benchmark_parameters(
231232
clientconfig,
232233
full_benchmark_path,
@@ -771,7 +772,6 @@ def delete_temporary_files(
771772
False,
772773
)
773774

774-
775775
if (
776776
arbitrary_command
777777
and oss_cluster_api_enabled

redis_benchmarks_specification/__self_contained_coordinator__/clients.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ def prepare_vector_db_benchmark_parameters(
3333
benchmark_command = []
3434
if port is not None:
3535
benchmark_command.extend(["REDIS_PORT={}".format(port)])
36-
benchmark_command.extend([
37-
full_benchmark_path,
38-
"--host",
39-
f"{server}",
40-
])
41-
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-m-8-ef-16")])
42-
benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")])
36+
benchmark_command.extend(
37+
[
38+
full_benchmark_path,
39+
"--host",
40+
f"{server}",
41+
]
42+
)
43+
benchmark_command.extend(
44+
["--engines", clientconfig.get("engines", "redis-m-8-ef-16")]
45+
)
46+
benchmark_command.extend(
47+
["--datasets", clientconfig.get("datasets", "glove-100-angular")]
48+
)
4349
benchmark_command_str = " ".join(benchmark_command)
4450
return None, benchmark_command_str
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import os
22
import json
33

4+
45
def post_process_vector_db(temporary_dir):
5-
results_dir = os.path.join(temporary_dir, 'results')
6+
results_dir = os.path.join(temporary_dir, "results")
67
results = {}
78
for file in os.listdir(results_dir):
89
if "upload" in file:
9-
with open(os.path.join(results_dir, file), 'r') as f:
10+
with open(os.path.join(results_dir, file), "r") as f:
1011
upload_results = json.load(f)
11-
results['upload_time'] = upload_results['results']['upload_time']
12+
results["upload_time"] = upload_results["results"]["upload_time"]
1213
else:
13-
with open(os.path.join(results_dir, file), 'r') as f:
14+
with open(os.path.join(results_dir, file), "r") as f:
1415
query_results = json.load(f)
15-
results['rps'] = query_results['results']['rps']
16-
results['precision'] = query_results['results']['mean_precisions']
17-
results['total_time'] = query_results['results']['total_time']
16+
results["rps"] = query_results["results"]["rps"]
17+
results["precision"] = query_results["results"]["mean_precisions"]
18+
results["total_time"] = query_results["results"]["total_time"]
1819
return results

redis_benchmarks_specification/__self_contained_coordinator__/runners.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ def process_self_contained_coordinator_stream(
412412
False,
413413
)
414414

415-
416415
client_container_image = extract_client_container_image(
417416
benchmark_config
418417
)

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
import time
1616

1717
from docker.models.containers import Container
18-
from redis_benchmarks_specification.__self_contained_coordinator__.post_processing import post_process_vector_db
18+
from redis_benchmarks_specification.__self_contained_coordinator__.post_processing import (
19+
post_process_vector_db,
20+
)
1921
from redisbench_admin.profilers.profilers_local import (
2022
check_compatible_system_and_kernel_and_prepare_profile,
2123
)
@@ -1025,7 +1027,7 @@ def process_self_contained_coordinator_stream(
10251027
"mode": "rw",
10261028
},
10271029
},
1028-
#auto_remove=True,
1030+
auto_remove=True,
10291031
privileged=True,
10301032
working_dir=benchmark_tool_workdir,
10311033
command=benchmark_command_str,
@@ -1034,8 +1036,16 @@ def process_self_contained_coordinator_stream(
10341036
cpuset_cpus=client_cpuset_cpus,
10351037
)
10361038
except docker.errors.ContainerError as e:
1037-
logging.info("stdout: {}".format(e.container.logs(stdout=True)))
1038-
logging.info("stderr: {}".format(e.container.logs(stderr=True)))
1039+
logging.info(
1040+
"stdout: {}".format(
1041+
e.container.logs(stdout=True)
1042+
)
1043+
)
1044+
logging.info(
1045+
"stderr: {}".format(
1046+
e.container.logs(stderr=True)
1047+
)
1048+
)
10391049
raise e
10401050

10411051
benchmark_end_time = datetime.datetime.now()
@@ -1159,8 +1169,12 @@ def process_self_contained_coordinator_stream(
11591169
):
11601170
datapoint_time_ms = git_timestamp_ms
11611171
if "vector_db_benchmark" in benchmark_tool:
1162-
print(f"Debug: Post-processing vector-db-benchmark results")
1163-
results_dict = post_process_vector_db(temporary_dir_client)
1172+
print(
1173+
f"Debug: Post-processing vector-db-benchmark results"
1174+
)
1175+
results_dict = post_process_vector_db(
1176+
temporary_dir_client
1177+
)
11641178
print(f"Debug: results: {results_dict}")
11651179
else:
11661180
post_process_benchmark_results(

0 commit comments

Comments
 (0)