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
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.79"
version = "0.1.80"
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
22 changes: 14 additions & 8 deletions redisbench_admin/run/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ def prepare_benchmark_parameters(
)

if "ycsb" in benchmark_tool:
if isremote is True:
benchmark_tool = (
"/tmp/ycsb-redisearch-binding-0.18.0-SNAPSHOT/bin/ycsb"
)
current_workdir = "/tmp/ycsb-redisearch-binding-0.18.0-SNAPSHOT"
command_arr, command_str = prepare_ycsb_benchmark_command(
benchmark_tool,
server_private_ip,
Expand Down Expand Up @@ -122,14 +127,15 @@ def run_remote_benchmark(
logging.info("remote process stdout: {}".format(stdout))
logging.info("Extracting the benchmark results")
remote_run_result = True
fetch_file_from_remote_setup(
client_public_ip,
username,
private_key,
local_results_file,
remote_results_file,
)
return remote_run_result
if "ycsb" not in command:
fetch_file_from_remote_setup(
client_public_ip,
username,
private_key,
local_results_file,
remote_results_file,
)
return remote_run_result, stdout, stderr


def common_exporter_logic(
Expand Down
4 changes: 3 additions & 1 deletion redisbench_admin/run/ycsb/ycsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def post_process_ycsb_results(stdout, start_time_ms, start_time_str):
}
if type(stdout) == bytes:
stdout = stdout.decode("ascii")
csv_data = list(csv.reader(stdout.splitlines(), delimiter=","))
if type(stdout) is not list:
stdout = stdout.splitlines()
csv_data = list(csv.reader(stdout, delimiter=","))
start_row = 0
for row in csv_data:
if len(row) >= 1:
Expand Down
16 changes: 14 additions & 2 deletions redisbench_admin/run_remote/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from redisbench_admin.utils.redisgraph_benchmark_go import (
spin_up_standalone_remote_redis,
setup_remote_benchmark_tool_redisgraph_benchmark_go,
setup_remote_benchmark_tool_ycsb_redisearch,
)
from redisbench_admin.utils.remote import (
extract_git_vars,
Expand Down Expand Up @@ -396,6 +397,12 @@ def run_remote_command_logic(args):
private_key,
redisbenchmark_go_link,
)
if "ycsb" in benchmark_tool:
setup_remote_benchmark_tool_ycsb_redisearch(
client_public_ip,
username,
private_key,
)
if "tsbs_" in benchmark_tool:
(
queries_file_link,
Expand Down Expand Up @@ -456,7 +463,7 @@ def run_remote_command_logic(args):
tmp = local_benchmark_output_filename
local_benchmark_output_filename = "result.csv"
# run the benchmark
run_remote_benchmark(
_, stdout, _ = run_remote_benchmark(
client_public_ip,
username,
private_key,
Expand All @@ -465,11 +472,12 @@ def run_remote_command_logic(args):
command_str,
)

if benchmark_tool == "redis-benchmark" or benchmark_tool == "ycsb":
if benchmark_tool == "redis-benchmark":
local_benchmark_output_filename = tmp
with open("result.csv", "r") as txt_file:
stdout = txt_file.read()

if benchmark_tool == "redis-benchmark" or benchmark_tool == "ycsb":
post_process_benchmark_results(
benchmark_tool,
local_benchmark_output_filename,
Expand Down Expand Up @@ -575,6 +583,10 @@ def run_remote_command_logic(args):
traceback.print_exc(file=sys.stdout)
print("-" * 60)

else:
logging.info(
"Test {} does not have remote config. Skipping test.".format(test_name)
)
for remote_setup_name, tf in remote_envs.items():
# tear-down
logging.info("Tearing down setup {}".format(remote_setup_name))
Expand Down
13 changes: 13 additions & 0 deletions redisbench_admin/utils/redisgraph_benchmark_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,16 @@ def setup_remote_benchmark_tool_redisgraph_benchmark_go(
"chmod 755 /tmp/redisgraph-benchmark-go",
]
execute_remote_commands(client_public_ip, username, private_key, commands)


def setup_remote_benchmark_tool_ycsb_redisearch(
client_public_ip,
username,
private_key,
tool_link="https://s3.amazonaws.com/benchmarks.redislabs/redisearch/ycsb/ycsb-redisearch-binding-0.18.0-SNAPSHOT.tar.gz",
):
commands = [
"wget {} -q -O /tmp/ycsb.tar.gz".format(tool_link),
"tar -xvf /tmp/ycsb.tar.gz -C /tmp",
]
execute_remote_commands(client_public_ip, username, private_key, commands)
5 changes: 4 additions & 1 deletion redisbench_admin/utils/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ def post_process_benchmark_results(
local_benchmark_output_filename
)
)
ycsb_input = stdout
if type(ycsb_input) == bytes:
ycsb_input = ycsb_input.decode("ascii")
results_dict = post_process_ycsb_results(
stdout.decode("ascii"),
ycsb_input,
start_time_ms,
start_time_str,
)
Expand Down