Skip to content

Commit 2acdeed

Browse files
committed
Allow to specify a test to run on cli runner
1 parent 0277988 commit 2acdeed

File tree

6 files changed

+447
-237
lines changed

6 files changed

+447
-237
lines changed

poetry.lock

Lines changed: 304 additions & 225 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ argparse = "^1.4.0"
1616
Flask-HTTPAuth = "^4.4.0"
1717
PyYAML = "^5.4.1"
1818
docker = "^5.0.0"
19-
redisbench-admin = "^0.5.27"
20-
# redisbench-admin = {path = "../redisbench-admin", develop = true}
19+
redisbench-admin = "^0.6.12"
20+
#redisbench-admin = {path = "../redisbench-admin", develop = true}
2121
psutil = "^5.8.0"
2222
tox-docker = "^3.1.0"
2323
PyGithub = "^1.55"

redis_benchmarks_specification/__runner__/args.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ def create_client_runner_args(project_name):
3636
default=SPECS_PATH_TEST_SUITES,
3737
help="Test suites folder, containing the different test variations",
3838
)
39+
parser.add_argument(
40+
"--test",
41+
type=str,
42+
default="",
43+
help="specify a test to run. By default will run all the tests"
44+
+ " present in the folder specified in --test-suites-folder.",
45+
)
3946
parser.add_argument("--db_server_host", type=str, default="localhost")
4047
parser.add_argument("--db_server_port", type=int, default=6379)
48+
parser.add_argument("--cpuset_start_pos", type=int, default=0)
4149
parser.add_argument(
4250
"--datasink_redistimeseries_host", type=str, default=DATASINK_RTS_HOST
4351
)

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def main():
7272
logging.info(get_version_string(project_name, project_version))
7373
testsuites_folder = os.path.abspath(args.test_suites_folder)
7474
logging.info("Using test-suites folder dir {}".format(testsuites_folder))
75-
testsuite_spec_files = get_benchmark_specs(testsuites_folder)
75+
testsuite_spec_files = get_benchmark_specs(testsuites_folder, args.test)
7676
logging.info(
7777
"There are a total of {} test-suites in folder {}".format(
7878
len(testsuite_spec_files), testsuites_folder
@@ -175,7 +175,7 @@ def process_self_contained_coordinator_stream(
175175
for topology_spec_name in benchmark_config["redis-topologies"]:
176176
test_result = False
177177
try:
178-
current_cpu_pos = 0
178+
current_cpu_pos = args.cpuset_start_pos
179179
temporary_dir_client = tempfile.mkdtemp(dir=home)
180180

181181
tf_github_org = args.github_org
@@ -318,7 +318,7 @@ def process_self_contained_coordinator_stream(
318318
full_result_path = "{}/{}".format(
319319
temporary_dir_client, local_benchmark_output_filename
320320
)
321-
logging.critical(
321+
logging.info(
322322
"Reading results json from {}".format(full_result_path)
323323
)
324324

@@ -330,7 +330,7 @@ def process_self_contained_coordinator_stream(
330330
logging.info("Final JSON result {}".format(results_dict))
331331
dataset_load_duration_seconds = 0
332332

333-
logging.error(
333+
logging.info(
334334
"Using datapoint_time_ms: {}".format(datapoint_time_ms)
335335
)
336336

@@ -464,12 +464,19 @@ def data_prepopulation_step(
464464
)
465465

466466

467-
def get_benchmark_specs(testsuites_folder):
468-
files = pathlib.Path(testsuites_folder).glob("*.yml")
469-
files = [str(x) for x in files]
470-
logging.info(
471-
"Running all specified benchmarks: {}".format(" ".join([str(x) for x in files]))
472-
)
467+
def get_benchmark_specs(testsuites_folder, test):
468+
if test == "":
469+
files = pathlib.Path(testsuites_folder).glob("*.yml")
470+
files = [str(x) for x in files]
471+
logging.info(
472+
"Running all specified benchmarks: {}".format(
473+
" ".join([str(x) for x in files])
474+
)
475+
)
476+
else:
477+
files = test.split(",")
478+
files = ["{}/{}".format(testsuites_folder, x) for x in files]
479+
logging.info("Running specific benchmark in file: {}".format(files))
473480
return files
474481

475482

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
version: 0.4
2+
name: "redis-benchmark-full-suite-1Mkeys-100B-pipeline-10"
3+
description: "Runs the default redis-benchmark test suite, for a keyspace length of 1M keys
4+
with a data size of 100 Bytes for each key. On total 50 concurrent connections
5+
will be used, sending 1M requests."
6+
dbconfig:
7+
- configuration-parameters:
8+
- save: '""'
9+
tested-commands:
10+
- PING
11+
- SET
12+
- GET
13+
- INCR
14+
- LPUSH
15+
- RPUSH
16+
- LPOP
17+
- RPOP
18+
- SADD
19+
- SPOP
20+
- ZADD
21+
- ZPOPMIN
22+
- LRANGE
23+
- MSET
24+
redis-topologies:
25+
- oss-standalone
26+
27+
build-variants:
28+
- gcc:8.5.0-amd64-debian-buster-default
29+
30+
clientconfig:
31+
run_image: redis:6.2.4
32+
tool: redis-benchmark
33+
min-tool-version: "6.2.0"
34+
parameters:
35+
- clients: 50
36+
- requests: 1000000
37+
- threads: 3
38+
- pipeline: 1
39+
- keyspacelen: 1000000
40+
- size: 100
41+
resources:
42+
requests:
43+
cpus: "3"
44+
memory: "2g"
45+
exporter:
46+
redistimeseries:
47+
break_by:
48+
- version
49+
- commit
50+
timemetric: "$.StartTime"
51+
metrics:
52+
- "$.Tests.*.rps"
53+
- "$.Tests.*.avg_latency_ms"
54+
- "$.Tests.*.p50_latency_ms"
55+
- "$.Tests.*.p95_latency_ms"
56+
- "$.Tests.*.p99_latency_ms"
57+
- "$.Tests.*.max_latency_ms"
58+
- "$.Tests.*.min_latency_ms"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
version: 0.4
2+
name: "redis-benchmark-full-suite-1Mkeys-1KiB-pipeline-10"
3+
description: "Runs the default redis-benchmark test suite, for a keyspace length of 1M keys
4+
with a data size of 1000 Bytes for each key. On total 50 concurrent connections
5+
will be used, sending 1M requests."
6+
dbconfig:
7+
- configuration-parameters:
8+
- save: '""'
9+
tested-commands:
10+
- PING
11+
- SET
12+
- GET
13+
- INCR
14+
- LPUSH
15+
- RPUSH
16+
- LPOP
17+
- RPOP
18+
- SADD
19+
- SPOP
20+
- ZADD
21+
- ZPOPMIN
22+
- LRANGE
23+
- MSET
24+
redis-topologies:
25+
- oss-standalone
26+
27+
build-variants:
28+
- gcc:8.5.0-amd64-debian-buster-default
29+
30+
clientconfig:
31+
run_image: redis:6.2.4
32+
tool: redis-benchmark
33+
min-tool-version: "6.2.0"
34+
parameters:
35+
- clients: 50
36+
- requests: 1000000
37+
- threads: 3
38+
- pipeline: 10
39+
- keyspacelen: 1000000
40+
- size: 1000
41+
resources:
42+
requests:
43+
cpus: "3"
44+
memory: "2g"
45+
exporter:
46+
redistimeseries:
47+
break_by:
48+
- version
49+
- commit
50+
timemetric: "$.StartTime"
51+
metrics:
52+
- "$.Tests.*.rps"
53+
- "$.Tests.*.avg_latency_ms"
54+
- "$.Tests.*.p50_latency_ms"
55+
- "$.Tests.*.p95_latency_ms"
56+
- "$.Tests.*.p99_latency_ms"
57+
- "$.Tests.*.max_latency_ms"
58+
- "$.Tests.*.min_latency_ms"

0 commit comments

Comments
 (0)