Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions redisbench_admin/run/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ def create_run_arguments(parser):
help="benchmark config file to read instructions from. can be a local file or a remote link")
parser.add_argument('--workers', type=str, default=0,
help='number of workers to use during the benchark. If set to 0 it will auto adjust based on the machine number of VCPUs')
parser.add_argument('--run-only-steps', type=str, default="",
help='Comma separated list of use-case steps to run. By default it will run all specified steps.')
parser.add_argument('--repetitions', type=int, default=1,
help='number of repetitions to run')
parser.add_argument('--benchmark-requests', type=int, default=0,
Expand All @@ -16,6 +18,10 @@ def create_run_arguments(parser):
help='number of database shards used in the deployment')
parser.add_argument('--pipeline', type=int, default=1,
help='pipeline requests to Redis')
parser.add_argument('--skip-teardown', default=False, action='store_true',
help="If enabled will skip any teardown steps.")
parser.add_argument('--continue-on-error', default=False, action='store_true',
help="If enabled will continue on Redis ERR replies and only print the message.")
parser.add_argument('--cluster-mode', default=False, action='store_true', help="Run client in cluster mode")
parser.add_argument('--max-rps', type=int, default=0,
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.")
Expand Down
5 changes: 3 additions & 2 deletions redisbench_admin/run/ftsb_redisearch/ftsb_redisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_run_options():


def run_ftsb_redisearch(redis_url, ftsb_redisearch_path, setup_run_json_output_fullpath, options, input_file, workers=1,
pipeline=1, oss_cluster_mode=False, max_rps=0, requests=0, args=[] ):
pipeline=1, oss_cluster_mode=False, max_rps=0, requests=0, continue_on_error=False, args=[] ):
##################
# Setup commands #
##################
Expand All @@ -49,7 +49,8 @@ def run_ftsb_redisearch(redis_url, ftsb_redisearch_path, setup_run_json_output_f
ftsb_args += ["--requests={}".format(requests)]
if oss_cluster_mode:
ftsb_args += ["--cluster-mode"]
ftsb_args += ["--continue-on-error"]
if continue_on_error:
ftsb_args += ["--continue-on-error"]

ftsb_process = subprocess.Popen(args=ftsb_args, **options)
if ftsb_process.poll() is not None:
Expand Down
56 changes: 39 additions & 17 deletions redisbench_admin/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def run_command_logic(args):
oss_cluster_mode = args.cluster_mode
max_rps = args.max_rps
requests = args.requests
continue_on_error = args.continue_on_error
run_only_steps = None
skip_teardown = args.skip_teardown
if args.run_only_steps != "":
run_only_steps = args.run_only_steps.split(",")


benchmark_machine_info = cpuinfo.get_cpu_info()
total_cores = benchmark_machine_info['count']
Expand Down Expand Up @@ -124,30 +130,46 @@ def run_command_logic(args):
if benchmark_repetitions_require_teardown is True or repetition == 1:
aux_client = run_setup_commands(args, "setup", benchmark_config["setup"]["commands"], oss_cluster_mode)
if "setup" in run_stages_inputs:
setup_run_key = "setup-run-{}.json".format(repetition)
setup_run_json_output_fullpath = "{}/{}".format(local_path, setup_run_key)
input_file = run_stages_inputs["setup"]
benchmark_output_dict["setup"][setup_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
setup_run_json_output_fullpath,
options, input_file, workers,
pipeline, oss_cluster_mode, 0, 0)
run_setup_step = True
if run_only_steps is not None and "setup" not in run_only_steps:
run_setup_step = False
if run_setup_step:
setup_run_key = "setup-run-{}.json".format(repetition)
setup_run_json_output_fullpath = "{}/{}".format(local_path, setup_run_key)
input_file = run_stages_inputs["setup"]
benchmark_output_dict["setup"][setup_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
setup_run_json_output_fullpath,
options, input_file, workers,
pipeline, oss_cluster_mode, 0, 0, continue_on_error)
else:
print("Skipping setup step since it's not present in: {}".format(run_only_steps))
progress.update()

######################
# Benchmark commands #
######################
benchmark_run_key = "benchmark-run-{}.json".format(repetition)
benchmark_run_json_output_fullpath = "{}/{}".format(local_path, benchmark_run_key)
input_file = run_stages_inputs["benchmark"]

benchmark_output_dict["benchmark"][benchmark_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
benchmark_run_json_output_fullpath,
options, input_file, workers,
pipeline, oss_cluster_mode, max_rps, requests)
run_benchmark_step = True
if run_only_steps is not None and "benchmark" not in run_only_steps:
run_benchmark_step = False

if run_benchmark_step:
benchmark_run_key = "benchmark-run-{}.json".format(repetition)
benchmark_run_json_output_fullpath = "{}/{}".format(local_path, benchmark_run_key)
input_file = run_stages_inputs["benchmark"]

benchmark_output_dict["benchmark"][benchmark_run_key] = run_ftsb_redisearch(args.redis_url, benchmark_tool_path,
benchmark_run_json_output_fullpath,
options, input_file, workers,
pipeline, oss_cluster_mode, max_rps, requests, continue_on_error)
else:
print("Skipping benchmark step since it's not present in: {}".format(run_only_steps))

if benchmark_repetitions_require_teardown is True or repetition == args.repetitions:
print("Running tear down steps...")
run_setup_commands(args, "tear down", benchmark_config["teardown"]["commands"], oss_cluster_mode)
if skip_teardown is False:
print("Running tear down steps...")
run_setup_commands(args, "tear down", benchmark_config["teardown"]["commands"], oss_cluster_mode)
else:
print("Implicitly skipping teardown step due to --skip-teardown flag")

progress.update()
end_time = dt.datetime.now()
Expand Down