Skip to content

Commit 704b19d

Browse files
Included ZCARD and HMGET tests (#144)
1 parent d2d473e commit 704b19d

6 files changed

+99
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# work files
22
*.csv
3+
utils/tests/test_data/dump.rdb
34

45
# mac
56

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 0.4
2+
name: memtier_benchmark-1Mkeys-hash-hmget-5-fields-with-100B-values-pipeline-10
3+
description: Runs memtier_benchmark, for a keyspace length of 1M keys pre-loading HASHes in which the value has a data size of 100 Bytes. After pre-loading the data it issues HMGET command retrieving all fields of the hash.
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
preload_tool:
8+
run_image: redislabs/memtier_benchmark:edge
9+
tool: memtier_benchmark
10+
arguments: '"--data-size" "100" --command "HSET __key__ field1 __data__ field2 __data__ field3 __data__ field4 __data__ field5 __data__" --command-key-pattern="P" --key-minimum=1 --key-maximum 10000000 -n 5000 -c 50 -t 4 --hide-histogram'
11+
tested-groups:
12+
- hash
13+
tested-commands:
14+
- hmget
15+
redis-topologies:
16+
- oss-standalone
17+
build-variants:
18+
- gcc:8.5.0-amd64-debian-buster-default
19+
clientconfig:
20+
run_image: redislabs/memtier_benchmark:edge
21+
tool: memtier_benchmark
22+
arguments: '--pipeline 10 --command "HMGET __key__ field1 field2 field3 field4 field5" --command-key-pattern="R" --key-minimum=1 --key-maximum 1000000 --test-time 180 -c 50 -t 4 --hide-histogram'
23+
resources:
24+
requests:
25+
cpus: '4'
26+
memory: 2g
27+
exporter:
28+
redistimeseries:
29+
break_by:
30+
- version
31+
- commit
32+
timemetric: $."ALL STATS".Runtime."Start time"
33+
metrics:
34+
- $."ALL STATS".Totals."Ops/sec"
35+
- $."ALL STATS".Totals."Latency"
36+
- $."ALL STATS".Totals."Misses/sec"
37+
- $."ALL STATS".Totals."Percentile Latencies"."p50.00"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 0.4
2+
name: memtier_benchmark-1key-zset-1M-elements-zcard-pipeline-10
3+
description: 'Runs memtier_benchmark, for a keyspace length of 1 SORTED SET key. The SORTED SET contains 1M elements in it and we query it using ZCARD.'
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
preload_tool:
8+
run_image: redislabs/memtier_benchmark:edge
9+
tool: memtier_benchmark
10+
arguments: --key-maximum 1000000 --key-prefix "" --command="ZADD lb __key__ __key__" --command-key-pattern P --hide-histogram -t 4 -c 100
11+
tested-groups:
12+
- sorted-set
13+
tested-commands:
14+
- zcard
15+
redis-topologies:
16+
- oss-standalone
17+
build-variants:
18+
- gcc:8.5.0-amd64-debian-buster-default
19+
clientconfig:
20+
run_image: redislabs/memtier_benchmark:edge
21+
tool: memtier_benchmark
22+
arguments: --command="ZCARD lb" --hide-histogram --test-time 180 --pipeline 10
23+
resources:
24+
requests:
25+
cpus: '4'
26+
memory: 2g
27+
exporter:
28+
redistimeseries:
29+
break_by:
30+
- version
31+
- commit
32+
timemetric: $."ALL STATS".Runtime."Start time"
33+
metrics:
34+
- $."ALL STATS".Totals."Ops/sec"
35+
- $."ALL STATS".Totals."Latency"
36+
- $."ALL STATS".Totals."Misses/sec"
37+
- $."ALL STATS".Totals."Percentile Latencies"."p50.00"

utils/tests/test_data/dump.rdb

0 Bytes
Binary file not shown.

utils/tests/test_self_contained_coordinator.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
)
3232
from redis_benchmarks_specification.__setups__.topologies import get_topologies
3333
from utils.tests.test_data.api_builder_common import flow_1_and_2_api_builder_checks
34+
from utils.tests.test_self_contained_coordinator_memtier import rdb_load_in_tests
3435

3536

3637
def test_extract_client_cpu_limit():
@@ -98,15 +99,10 @@ def test_self_contained_coordinator_blocking_read():
9899
if run_coordinator:
99100
conn = redis.StrictRedis(port=16379)
100101
conn.ping()
101-
use_rdb = True
102-
TST_RUNNER_USE_RDB = os.getenv("TST_RUNNER_USE_RDB", "1")
103102
build_variant_name = "gcc:8.5.0-amd64-debian-buster-default"
104103
expected_datapoint_ts = None
105-
if TST_RUNNER_USE_RDB == "0":
106-
use_rdb = False
107-
if use_rdb:
108-
conn.execute_command("DEBUG", "RELOAD", "NOSAVE")
109-
else:
104+
use_rdb = rdb_load_in_tests(conn)
105+
if use_rdb is False:
110106
conn.flushall()
111107
build_variant_name, reply_fields = flow_1_and_2_api_builder_checks(conn)
112108
if b"git_timestamp_ms" in reply_fields:
@@ -270,9 +266,6 @@ def test_self_contained_coordinator_blocking_read():
270266
assert len(datasink_conn.smembers(testcases_setname)) == 1
271267
assert len(datasink_conn.smembers(project_branches_setname)) == 1
272268
assert len(datasink_conn.smembers(project_versions_setname)) == 0
273-
# ensure we don't change state on the rdb
274-
if use_rdb:
275-
conn.execute_command("DEBUG", "RELOAD", "NOSAVE")
276269

277270
except redis.exceptions.ConnectionError:
278271
pass

utils/tests/test_self_contained_coordinator_memtier.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,10 @@ def test_self_contained_coordinator_blocking_read():
3737
if run_coordinator:
3838
conn = redis.StrictRedis(port=16379)
3939
conn.ping()
40-
use_rdb = True
41-
TST_RUNNER_USE_RDB = os.getenv("TST_RUNNER_USE_RDB", "1")
4240
build_variant_name = "gcc:8.5.0-amd64-debian-buster-default"
4341
expected_datapoint_ts = None
44-
if TST_RUNNER_USE_RDB == "0":
45-
use_rdb = False
46-
if use_rdb:
47-
conn.execute_command("DEBUG", "RELOAD", "NOSAVE")
48-
else:
42+
use_rdb = rdb_load_in_tests(conn)
43+
if use_rdb is False:
4944
conn.flushall()
5045
build_variant_name, reply_fields = flow_1_and_2_api_builder_checks(conn)
5146
if b"git_timestamp_ms" in reply_fields:
@@ -200,6 +195,23 @@ def test_self_contained_coordinator_blocking_read():
200195
pass
201196

202197

198+
def rdb_load_in_tests(conn):
199+
use_rdb = True
200+
TST_RUNNER_USE_RDB = os.getenv("TST_RUNNER_USE_RDB", "1")
201+
if TST_RUNNER_USE_RDB == "0":
202+
use_rdb = False
203+
if use_rdb:
204+
try:
205+
conn.execute_command("DEBUG", "RELOAD", "NOSAVE")
206+
except redis.exceptions.ResponseError as e:
207+
if "DEBUG command not allowed" in e.__str__():
208+
use_rdb = False
209+
pass
210+
else:
211+
raise e
212+
return use_rdb
213+
214+
203215
def test_self_contained_coordinator_skip_build_variant():
204216
try:
205217
run_coordinator = True
@@ -209,15 +221,10 @@ def test_self_contained_coordinator_skip_build_variant():
209221
if run_coordinator:
210222
conn = redis.StrictRedis(port=16379)
211223
conn.ping()
212-
use_rdb = True
213-
TST_RUNNER_USE_RDB = os.getenv("TST_RUNNER_USE_RDB", "1")
214224
build_variant_name = "gcc:8.5.0-amd64-debian-buster-default"
215225
expected_datapoint_ts = None
216-
if TST_RUNNER_USE_RDB == "0":
217-
use_rdb = False
218-
if use_rdb:
219-
conn.execute_command("DEBUG", "RELOAD", "NOSAVE")
220-
else:
226+
use_rdb = rdb_load_in_tests(conn)
227+
if use_rdb is False:
221228
conn.flushall()
222229
build_variant_name, reply_fields = flow_1_and_2_api_builder_checks(conn)
223230
if b"git_timestamp_ms" in reply_fields:

0 commit comments

Comments
 (0)