Skip to content

Commit 84fb7d8

Browse files
committed
Add basic vector_db_benchmark test, add method to create benchmark running command
1 parent f424438 commit 84fb7d8

File tree

2 files changed

+81
-16
lines changed

2 files changed

+81
-16
lines changed

redis_benchmarks_specification/__runner__/runner.py

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

206+
def prepare_vector_db_benchmark_parameters(
207+
clientconfig,
208+
full_benchmark_path,
209+
port,
210+
server,
211+
password,
212+
):
213+
benchmark_command = []
214+
if port is not None:
215+
benchmark_command.extend(["REDIS_PORT={}".format(port)])
216+
if password is not None:
217+
benchmark_command.extend(["REDIS_AUTH={}".format(password)])
218+
benchmark_command.extend([
219+
full_benchmark_path,
220+
"--host",
221+
f"{server}",
222+
])
223+
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-m-8-ef-16")])
224+
benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")])
225+
benchmark_command_str = " ".join(benchmark_command)
226+
return None, benchmark_command_str
206227

207228
def prepare_memtier_benchmark_parameters(
208229
clientconfig,
@@ -699,22 +720,7 @@ def delete_temporary_files(
699720
)
700721
arbitrary_command = False
701722

702-
if "memtier_benchmark" not in benchmark_tool:
703-
# prepare the benchmark command
704-
(
705-
benchmark_command,
706-
benchmark_command_str,
707-
) = prepare_benchmark_parameters(
708-
benchmark_config,
709-
full_benchmark_path,
710-
port,
711-
host,
712-
local_benchmark_output_filename,
713-
False,
714-
benchmark_tool_workdir,
715-
False,
716-
)
717-
else:
723+
if "memtier_benchmark" in benchmark_tool:
718724
(
719725
_,
720726
benchmark_command_str,
@@ -736,6 +742,33 @@ def delete_temporary_files(
736742
override_memtier_test_time,
737743
override_test_runs,
738744
)
745+
elif "vector_db_benchmark" in benchmark_tool:
746+
(
747+
_,
748+
benchmark_command_str,
749+
) = prepare_vector_db_benchmark_parameters(
750+
benchmark_config["clientconfig"],
751+
full_benchmark_path,
752+
port,
753+
host,
754+
password,
755+
)
756+
else:
757+
# prepare the benchmark command
758+
(
759+
benchmark_command,
760+
benchmark_command_str,
761+
) = prepare_benchmark_parameters(
762+
benchmark_config,
763+
full_benchmark_path,
764+
port,
765+
host,
766+
local_benchmark_output_filename,
767+
False,
768+
benchmark_tool_workdir,
769+
False,
770+
)
771+
739772

740773
if (
741774
arbitrary_command
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 0.4
2+
name: vector_db_benchmark_test
3+
description: Test if vector-db-benchmark can be run with this tool
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
check:
8+
keyspacelen: 0
9+
resources:
10+
requests:
11+
memory: 1g
12+
tested-groups:
13+
- redisearch
14+
tested-commands:
15+
- search
16+
redis-topologies:
17+
- oss-standalone
18+
build-variants:
19+
- gcc:8.5.0-amd64-debian-buster-default
20+
- dockerhub
21+
clientconfig:
22+
run_image: vector-db-benchmark:test
23+
tool: vector_db_benchmark
24+
dataset: glove-100-angular
25+
engine: redis-m-16-ef-64
26+
#arguments: '"--data-size" "100" --command "LPUSH __key__ __data__" --command-key-pattern="P" --key-minimum=1 --key-maximum 1000000 --test-time 180 -c 50 -t 4 --hide-histogram'
27+
resources:
28+
requests:
29+
cpus: '4'
30+
memory: 2g
31+
32+
priority: 38

0 commit comments

Comments
 (0)