Skip to content

Commit

Permalink
Added support for --requests arg on ftsb_redisearch (#16)
Browse files Browse the repository at this point in the history
* [add] Added support for --requests arg on ftsb_redisearch

* [add] Bump version from 0.1.19 to 0.1.20
  • Loading branch information
filipecosta90 authored Oct 10, 2020
1 parent 4e96c1c commit 7142156
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redisbench-admin"
version = "0.1.19"
version = "0.1.20"
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
authors = ["filipecosta90 <filipecosta.90@gmail.com>"]
readme = "README.md"
Expand Down
2 changes: 2 additions & 0 deletions redisbench_admin/run/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ def create_run_arguments(parser):
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.")
parser.add_argument('--output-file-prefix', type=str, default="", help='prefix to quickly tag some files')
parser.add_argument('--requests', type=int, default=0,
help='Number of total requests to issue (0 = all of the present in input file).')
return parser
4 changes: 3 additions & 1 deletion 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, args=[] ):
pipeline=1, oss_cluster_mode=False, max_rps=0, requests=0, args=[] ):
##################
# Setup commands #
##################
Expand All @@ -45,6 +45,8 @@ def run_ftsb_redisearch(redis_url, ftsb_redisearch_path, setup_run_json_output_f
"--json-out-file={}".format(setup_run_json_output_fullpath)]
if max_rps > 0:
ftsb_args += ["--max-rps", max_rps]
if requests > 0:
ftsb_args += ["--requests", requests]
if oss_cluster_mode:
ftsb_args += ["--cluster-mode"]

Expand Down
9 changes: 3 additions & 6 deletions redisbench_admin/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def run_command_logic(args):
pipeline = args.pipeline
oss_cluster_mode = args.cluster_mode
max_rps = args.max_rps
requests = args.requests

benchmark_machine_info = cpuinfo.get_cpu_info()
total_cores = benchmark_machine_info['count']
Expand Down Expand Up @@ -129,7 +130,7 @@ def run_command_logic(args):
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, max_rps)
pipeline, oss_cluster_mode, max_rps, requests)
progress.update()

######################
Expand All @@ -142,11 +143,7 @@ def run_command_logic(args):
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)

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)
pipeline, oss_cluster_mode, max_rps, requests)

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

0 comments on commit 7142156

Please sign in to comment.