Skip to content

Commit 7142156

Browse files
Added support for --requests arg on ftsb_redisearch (#16)
* [add] Added support for --requests arg on ftsb_redisearch * [add] Bump version from 0.1.19 to 0.1.20
1 parent 4e96c1c commit 7142156

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
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.19"
3+
version = "0.1.20"
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/args.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ def create_run_arguments(parser):
2020
parser.add_argument('--max-rps', type=int, default=0,
2121
help="enable limiting the rate of queries per second, 0 = no limit. " + "By default no limit is specified and the binaries will stress the DB up to the maximum.")
2222
parser.add_argument('--output-file-prefix', type=str, default="", help='prefix to quickly tag some files')
23+
parser.add_argument('--requests', type=int, default=0,
24+
help='Number of total requests to issue (0 = all of the present in input file).')
2325
return parser

redisbench_admin/run/ftsb_redisearch/ftsb_redisearch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_run_options():
3333

3434

3535
def run_ftsb_redisearch(redis_url, ftsb_redisearch_path, setup_run_json_output_fullpath, options, input_file, workers=1,
36-
pipeline=1, oss_cluster_mode=False, max_rps=0, args=[] ):
36+
pipeline=1, oss_cluster_mode=False, max_rps=0, requests=0, args=[] ):
3737
##################
3838
# Setup commands #
3939
##################
@@ -45,6 +45,8 @@ def run_ftsb_redisearch(redis_url, ftsb_redisearch_path, setup_run_json_output_f
4545
"--json-out-file={}".format(setup_run_json_output_fullpath)]
4646
if max_rps > 0:
4747
ftsb_args += ["--max-rps", max_rps]
48+
if requests > 0:
49+
ftsb_args += ["--requests", requests]
4850
if oss_cluster_mode:
4951
ftsb_args += ["--cluster-mode"]
5052

redisbench_admin/run/run.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def run_command_logic(args):
2929
pipeline = args.pipeline
3030
oss_cluster_mode = args.cluster_mode
3131
max_rps = args.max_rps
32+
requests = args.requests
3233

3334
benchmark_machine_info = cpuinfo.get_cpu_info()
3435
total_cores = benchmark_machine_info['count']
@@ -129,7 +130,7 @@ def run_command_logic(args):
129130
benchmark_output_dict["setup"][setup_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
130131
setup_run_json_output_fullpath,
131132
options, input_file, workers,
132-
pipeline, oss_cluster_mode, max_rps)
133+
pipeline, oss_cluster_mode, max_rps, requests)
133134
progress.update()
134135

135136
######################
@@ -142,11 +143,7 @@ def run_command_logic(args):
142143
benchmark_output_dict["benchmark"][benchmark_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
143144
benchmark_run_json_output_fullpath,
144145
options, input_file, workers,
145-
pipeline, oss_cluster_mode, max_rps)
146-
147-
if benchmark_repetitions_require_teardown is True or repetition == args.repetitions:
148-
print("Running tear down steps...")
149-
run_setup_commands(args, "tear down", benchmark_config["teardown"]["commands"], oss_cluster_mode)
146+
pipeline, oss_cluster_mode, max_rps, requests)
150147

151148
progress.update()
152149
end_time = dt.datetime.now()

0 commit comments

Comments
 (0)