Skip to content

Commit e7ce941

Browse files
Redisgraph benchmark go params (#165)
* [fix] Fixed watchdog redistimeseries args parsing * Bumping version from 0.3.4 to 0.3.5 * [add] Extended redisgraph-benchmark-go query parameters support
1 parent deb9564 commit e7ce941

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
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.3.5"
3+
version = "0.3.6"
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/redisgraph_benchmark_go/redisgraph_benchmark_go.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def prepare_redisgraph_benchmark_go_command(
3333
else:
3434
graph_key = k["graph"]
3535
queries_str.extend(["-graph-key", graph_key])
36-
if "clients" in k:
36+
elif "clients" in k:
3737
queries_str.extend(["-c", "{}".format(k["clients"])])
38-
if "requests" in k:
38+
elif "requests" in k:
3939
queries_str.extend(["-n", "{}".format(k["requests"])])
40-
if "rps" in k:
40+
elif "rps" in k:
4141
queries_str.extend(["-rps", "{}".format(k["rps"])])
42-
if "queries" in k:
42+
elif "queries" in k:
4343
for kk in k["queries"]:
4444
if is_remote:
4545
query = "'{}'".format(kk["q"])
@@ -48,6 +48,11 @@ def prepare_redisgraph_benchmark_go_command(
4848
queries_str.extend(["-query", query])
4949
if "ratio" in kk:
5050
queries_str.extend(["-query-ratio", "{}".format(kk["ratio"])])
51+
else:
52+
if "threads" not in k and "connections" not in k:
53+
for kk in k.keys():
54+
queries_str.extend(["-{}".format(kk), str(k[kk])])
55+
5156
queries_str.extend(["-h", "{}".format(server_private_ip)])
5257
queries_str.extend(["-p", "{}".format(server_plaintext_port)])
5358
queries_str.extend(["-json-out-file", "{}".format(results_file)])
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "graph500-scale18-ef16_1hop_MIXED_READ_75_WRITE_25p"
2+
description: "Dataset: Synthetic graph500 network of scale 18 (262144x262144, 4194304 edges)
3+
- 262017 nodes with label 'Node'
4+
- 4194304 relations of type 'IS_CONNECTED'
5+
- Indexed properties:
6+
- exact-match: IS_CONNECTED; [external_id]
7+
"
8+
remote:
9+
- setup: redisgraph-r5
10+
- type: oss-standalone
11+
dbconfig:
12+
- dataset: "https://s3.amazonaws.com/benchmarks.redislabs/redisgraph/datasets/graph500-scale18-ef16_v2.4.7_dump.rdb"
13+
- dataset_load_timeout_secs: 120
14+
clientconfig:
15+
- tool: redisgraph-benchmark-go
16+
- parameters:
17+
- graph: "graph500-scale18-ef16"
18+
- rps: 0
19+
- clients: 32
20+
- threads: 4
21+
- connections: 32
22+
- requests: 10000
23+
- random-int-max: 262016
24+
- random-seed: 12345
25+
- queries:
26+
- { q: "MATCH (n)-[:IS_CONNECTED]->(z) WHERE ID(n) = __rand_int__ RETURN ID(n), count(z)", ratio: 0.75 }
27+
- { q: "CYPHER Id1=__rand_int__ Id2=__rand_int__ MATCH (n1:Node {id: $Id1}) MATCH (n1:Node {id: $Id2}) MERGE (n1)-[rel:IS_CONNECTED]->(n2)", ratio: 0.25 }

tests/test_redisgraph_benchmark_go.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,16 @@ def test_prepare_redis_graph_benchmark_go_command():
1717
command_str
1818
== "redisgraph-benchmark-go -graph-key g -rps 0 -c 32 -n 1000000 -query MATCH (n) WHERE ID(n) = 0 SET n.v = n.v + 1 -query-ratio 1 -h localhost -p 6380 -json-out-file result.txt"
1919
)
20+
21+
def test_prepare_redis_graph_benchmark_go_new_command():
22+
with open("./tests/test_data/redisgraph-benchmark-go_2.yml", "r") as yml_file:
23+
benchmark_config = yaml.safe_load(yml_file)
24+
for k in benchmark_config["clientconfig"]:
25+
if "parameters" in k:
26+
command_arr, command_str = prepare_redisgraph_benchmark_go_command(
27+
"redisgraph-benchmark-go", "localhost", "6380", k, "result.txt"
28+
)
29+
assert (
30+
command_str
31+
== "redisgraph-benchmark-go -graph-key graph500-scale18-ef16 -rps 0 -c 32 -n 10000 -random-int-max 262016 -random-seed 12345 -query MATCH (n)-[:IS_CONNECTED]->(z) WHERE ID(n) = __rand_int__ RETURN ID(n), count(z) -query-ratio 0.75 -query CYPHER Id1=__rand_int__ Id2=__rand_int__ MATCH (n1:Node {id: $Id1}) MATCH (n1:Node {id: $Id2}) MERGE (n1)-[rel:IS_CONNECTED]->(n2) -query-ratio 0.25 -h localhost -p 6380 -json-out-file result.txt"
32+
)

0 commit comments

Comments
 (0)