Skip to content

Commit f1999b6

Browse files
Fixes related to redis-benchmark config (#113)
* [fix] Fixed -r and -d parameters of redis-benchmark
1 parent 0c3d58a commit f1999b6

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.1.78"
3+
version = "0.1.79"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run/redis_benchmark/redis_benchmark.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def prepare_redis_benchmark_command(
6767
command_arr.extend(["--threads", "{}".format(k["threads"])])
6868
if "pipeline" in k:
6969
command_arr.extend(["-P", "{}".format(k["pipeline"])])
70+
if "keyspacelen" in k:
71+
command_arr.extend(["-r", "{}".format(k["keyspacelen"])])
72+
if "size" in k:
73+
command_arr.extend(["-d", "{}".format(k["size"])])
7074
# if we have the command keywork then it needs to be at the end of args
7175
if "command" in k:
7276
last_str = k["command"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 0.2
2+
name: "bf_add_cap10K_err0.01"
3+
description: "bf.add test __rand_int__"
4+
remote:
5+
- type: oss-standalone
6+
- setup: redisearch-m5d
7+
clientconfig:
8+
- tool: redis-benchmark
9+
- min-tool-version: "6.2.0"
10+
- parameters:
11+
- clients: 16
12+
- requests: 1000000000
13+
- threads: 2
14+
- pipeline: 1
15+
- keyspacelen: 100000
16+
- size: 128
17+
- command: 'bf.add test __rand_int__'

tests/test_redis_benchmark.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ def test_prepare_redis_benchmark_command():
2323
)
2424

2525

26+
def test_prepare_redis_benchmark_command():
27+
with open("./tests/test_data/redis-benchmark2.yml", "r") as yml_file:
28+
benchmark_config = yaml.safe_load(yml_file)
29+
for k in benchmark_config["clientconfig"]:
30+
if "parameters" in k:
31+
command_arr, command_str = prepare_redis_benchmark_command(
32+
"redis-benchmark", "localhost", "6380", k
33+
)
34+
assert (
35+
command_str
36+
== "redis-benchmark -h localhost -p 6380 --csv -e -c 16 -n 1000000000 --threads 2 -P 1 -r 100000 -d 128 bf.add test __rand_int__"
37+
)
38+
39+
2640
def test_redis_benchmark_ensure_min_version_local():
2741
redis_benchmark_bin = shutil.which("redis-benchmark")
2842
if redis_benchmark_bin:

0 commit comments

Comments
 (0)