Skip to content

Commit e76e7a2

Browse files
Enable --cluster-mode on redisbench-admin run subcommands (#10)
* [add] Added support for cluster-mode on ftsb
1 parent 508976c commit e76e7a2

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

redisbench_admin/run/args.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
def create_run_arguments(parser):
23
parser.add_argument('--benchmark-config-file', type=str, required=True,
34
help="benchmark config file to read instructions from. can be a local file or a remote link")
@@ -16,5 +17,6 @@ def create_run_arguments(parser):
1617
help='number of database shards used in the deployment')
1718
parser.add_argument('--pipeline', type=int, default=1,
1819
help='pipeline requests to Redis')
20+
parser.add_argument('--cluster-mode',default=False, action='store_true',help="Run client in cluster mode")
1921
parser.add_argument('--output-file-prefix', type=str, default="", help='prefix to quickly tag some files')
2022
return parser

redisbench_admin/run/ftsb_redisearch/ftsb_redisearch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def get_run_options():
3232
return options
3333

3434

35-
def run_ftsb_redisearch(redis_url, ftsb_redisearch_path, setup_run_json_output_fullpath, options, input_file,
36-
workers=1,pipeline=1,args=[]):
35+
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=[] ):
3737
##################
3838
# Setup commands #
3939
##################
@@ -43,6 +43,9 @@ 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 oss_cluster_mode:
47+
ftsb_args += ["--cluster-mode"]
48+
4649
ftsb_process = subprocess.Popen(args=ftsb_args, **options)
4750
if ftsb_process.poll() is not None:
4851
print('Error while issuing setup commands. FTSB process is not alive. Exiting..')

redisbench_admin/run/run.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def run_command_logic(args):
2626
local_path = os.path.abspath(args.local_dir)
2727
workers = args.workers
2828
pipeline = args.pipeline
29+
oss_cluster_mode = args.cluster_mode
30+
2931
benchmark_machine_info = cpuinfo.get_cpu_info()
3032
total_cores = benchmark_machine_info['count']
3133
benchmark_infra = {"total-benchmark-machines": 0, "benchmark-machines": {}, "total-db-machines": 0,
@@ -122,10 +124,14 @@ def run_command_logic(args):
122124
setup_run_key = "setup-run-{}.json".format(repetition)
123125
setup_run_json_output_fullpath = "{}/{}".format(local_path, setup_run_key)
124126
input_file = run_stages_inputs["setup"]
125-
benchmark_output_dict["setup"][setup_run_key] = run_ftsb_redisearch(args.redis_url,
126-
benchmark_tool_path,
127+
benchmark_output_dict["setup"][setup_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
127128
setup_run_json_output_fullpath,
129+
<<<<<<< HEAD
130+
options, input_file, workers,
131+
pipeline, oss_cluster_mode)
132+
=======
128133
options, input_file, workers, pipeline)
134+
>>>>>>> master
129135
progress.update()
130136

131137
######################
@@ -135,10 +141,14 @@ def run_command_logic(args):
135141
benchmark_run_json_output_fullpath = "{}/{}".format(local_path, benchmark_run_key)
136142
input_file = run_stages_inputs["benchmark"]
137143

138-
benchmark_output_dict["benchmark"][benchmark_run_key] = run_ftsb_redisearch(args.redis_url,
139-
benchmark_tool_path,
144+
benchmark_output_dict["benchmark"][benchmark_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
140145
benchmark_run_json_output_fullpath,
146+
<<<<<<< HEAD
147+
options, input_file, workers,
148+
pipeline, oss_cluster_mode)
149+
=======
141150
options, input_file, workers, pipeline)
151+
>>>>>>> master
142152

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

0 commit comments

Comments
 (0)