Skip to content

Commit 4e96c1c

Browse files
Added support for max-rps on ftsb_redisearch (#15)
* [add] Added support for max-rps on ftsb_redisearch
1 parent 46be480 commit 4e96c1c

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
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.18"
3+
version = "0.1.19"
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
def create_run_arguments(parser):
32
parser.add_argument('--benchmark-config-file', type=str, required=True,
43
help="benchmark config file to read instructions from. can be a local file or a remote link")
@@ -17,6 +16,8 @@ def create_run_arguments(parser):
1716
help='number of database shards used in the deployment')
1817
parser.add_argument('--pipeline', type=int, default=1,
1918
help='pipeline requests to Redis')
20-
parser.add_argument('--cluster-mode',default=False, action='store_true',help="Run client in cluster mode")
19+
parser.add_argument('--cluster-mode', default=False, action='store_true', help="Run client in cluster mode")
20+
parser.add_argument('--max-rps', type=int, default=0,
21+
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.")
2122
parser.add_argument('--output-file-prefix', type=str, default="", help='prefix to quickly tag some files')
2223
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, args=[] ):
36+
pipeline=1, oss_cluster_mode=False, max_rps=0, args=[] ):
3737
##################
3838
# Setup commands #
3939
##################
@@ -43,6 +43,8 @@ def run_ftsb_redisearch(redis_url, ftsb_redisearch_path, setup_run_json_output_f
4343
"--input={}".format(input_file), "--workers={}".format(workers),
4444
"--pipeline={}".format(pipeline),
4545
"--json-out-file={}".format(setup_run_json_output_fullpath)]
46+
if max_rps > 0:
47+
ftsb_args += ["--max-rps", max_rps]
4648
if oss_cluster_mode:
4749
ftsb_args += ["--cluster-mode"]
4850

redisbench_admin/run/run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def run_command_logic(args):
2828
workers = args.workers
2929
pipeline = args.pipeline
3030
oss_cluster_mode = args.cluster_mode
31+
max_rps = args.max_rps
3132

3233
benchmark_machine_info = cpuinfo.get_cpu_info()
3334
total_cores = benchmark_machine_info['count']
@@ -128,7 +129,7 @@ def run_command_logic(args):
128129
benchmark_output_dict["setup"][setup_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
129130
setup_run_json_output_fullpath,
130131
options, input_file, workers,
131-
pipeline, oss_cluster_mode)
132+
pipeline, oss_cluster_mode, max_rps)
132133
progress.update()
133134

134135
######################
@@ -141,7 +142,7 @@ def run_command_logic(args):
141142
benchmark_output_dict["benchmark"][benchmark_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
142143
benchmark_run_json_output_fullpath,
143144
options, input_file, workers,
144-
pipeline, oss_cluster_mode)
145+
pipeline, oss_cluster_mode, max_rps)
145146

146147
if benchmark_repetitions_require_teardown is True or repetition == args.repetitions:
147148
print("Running tear down steps...")

0 commit comments

Comments
 (0)