@@ -30,6 +30,12 @@ def run_command_logic(args):
3030 oss_cluster_mode = args .cluster_mode
3131 max_rps = args .max_rps
3232 requests = args .requests
33+ continue_on_error = args .continue_on_error
34+ run_only_steps = None
35+ skip_teardown = args .skip_teardown
36+ if args .run_only_steps != "" :
37+ run_only_steps = args .run_only_steps .split ("," )
38+
3339
3440 benchmark_machine_info = cpuinfo .get_cpu_info ()
3541 total_cores = benchmark_machine_info ['count' ]
@@ -124,30 +130,46 @@ def run_command_logic(args):
124130 if benchmark_repetitions_require_teardown is True or repetition == 1 :
125131 aux_client = run_setup_commands (args , "setup" , benchmark_config ["setup" ]["commands" ], oss_cluster_mode )
126132 if "setup" in run_stages_inputs :
127- setup_run_key = "setup-run-{}.json" .format (repetition )
128- setup_run_json_output_fullpath = "{}/{}" .format (local_path , setup_run_key )
129- input_file = run_stages_inputs ["setup" ]
130- benchmark_output_dict ["setup" ][setup_run_key ] = run_ftsb_redisearch (args .redis_url , benchmark_tool_path ,
131- setup_run_json_output_fullpath ,
132- options , input_file , workers ,
133- pipeline , oss_cluster_mode , 0 , 0 )
133+ run_setup_step = True
134+ if run_only_steps is not None and "setup" not in run_only_steps :
135+ run_setup_step = False
136+ if run_setup_step :
137+ setup_run_key = "setup-run-{}.json" .format (repetition )
138+ setup_run_json_output_fullpath = "{}/{}" .format (local_path , setup_run_key )
139+ input_file = run_stages_inputs ["setup" ]
140+ benchmark_output_dict ["setup" ][setup_run_key ] = run_ftsb_redisearch (args .redis_url , benchmark_tool_path ,
141+ setup_run_json_output_fullpath ,
142+ options , input_file , workers ,
143+ pipeline , oss_cluster_mode , 0 , 0 , continue_on_error )
144+ else :
145+ print ("Skipping setup step since it's not present in: {}" .format (run_only_steps ))
134146 progress .update ()
135147
136148 ######################
137149 # Benchmark commands #
138150 ######################
139- benchmark_run_key = "benchmark-run-{}.json" .format (repetition )
140- benchmark_run_json_output_fullpath = "{}/{}" .format (local_path , benchmark_run_key )
141- input_file = run_stages_inputs ["benchmark" ]
142-
143- benchmark_output_dict ["benchmark" ][benchmark_run_key ] = run_ftsb_redisearch (args .redis_url , benchmark_tool_path ,
144- benchmark_run_json_output_fullpath ,
145- options , input_file , workers ,
146- pipeline , oss_cluster_mode , max_rps , requests )
151+ run_benchmark_step = True
152+ if run_only_steps is not None and "benchmark" not in run_only_steps :
153+ run_benchmark_step = False
154+
155+ if run_benchmark_step :
156+ benchmark_run_key = "benchmark-run-{}.json" .format (repetition )
157+ benchmark_run_json_output_fullpath = "{}/{}" .format (local_path , benchmark_run_key )
158+ input_file = run_stages_inputs ["benchmark" ]
159+
160+ benchmark_output_dict ["benchmark" ][benchmark_run_key ] = run_ftsb_redisearch (args .redis_url , benchmark_tool_path ,
161+ benchmark_run_json_output_fullpath ,
162+ options , input_file , workers ,
163+ pipeline , oss_cluster_mode , max_rps , requests , continue_on_error )
164+ else :
165+ print ("Skipping benchmark step since it's not present in: {}" .format (run_only_steps ))
147166
148167 if benchmark_repetitions_require_teardown is True or repetition == args .repetitions :
149- print ("Running tear down steps..." )
150- run_setup_commands (args , "tear down" , benchmark_config ["teardown" ]["commands" ], oss_cluster_mode )
168+ if skip_teardown is False :
169+ print ("Running tear down steps..." )
170+ run_setup_commands (args , "tear down" , benchmark_config ["teardown" ]["commands" ], oss_cluster_mode )
171+ else :
172+ print ("Implicitly skipping teardown step due to --skip-teardown flag" )
151173
152174 progress .update ()
153175 end_time = dt .datetime .now ()
0 commit comments