Skip to content

Commit d748195

Browse files
Enabled rlec related runs (using already existing env) (#371)
* Fixed execute_init_commands bug on L446 * Fixed remote results fetching from benchmark client * Extra logging on results fetching * Fixed is_ycsb_java check * working on removal of unecessary dependencies * Enabled rlec related runs (using already existing env)
1 parent 6393d90 commit d748195

File tree

16 files changed

+326
-177
lines changed

16 files changed

+326
-177
lines changed

poetry.lock

Lines changed: 41 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.9.15"
3+
version = "0.9.18"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
66
readme = "README.md"
@@ -36,9 +36,7 @@ daemonize = "^2.5.0"
3636
pandas = "^1.0"
3737
ansicolors = "^1.1.8"
3838
matplotlib = "^3.1.2"
39-
numpy = "^1.23.1"
4039
psutil = "^5.6.6"
41-
scipy = "^1.3.3"
4240
Jinja2 = "^3.0.3"
4341
watchdog = "^2.1.6"
4442
redis = "^4.2.2"

redisbench_admin/export/google_benchmark/google_benchmark_json_format.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#
66
import logging
77

8-
import numpy as np
9-
108

119
def metric_safe_name(row, replace_by="_"):
1210
import re

redisbench_admin/export/pyperf/pyperf_json_format.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# All rights reserved.
55
#
66
import logging
7-
87
import numpy as np
98

109

redisbench_admin/run/args.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
FAIL_FAST = bool(int(os.getenv("FAIL_FAST", 0)))
3131
PROFILERS_DSO = os.getenv("PROFILERS_DSO", None)
3232
GIT_ORG = os.getenv("GIT_ORG", None)
33+
GIT_BRANCH = os.getenv("GIT_BRANCH", None)
3334
GIT_REPO = os.getenv("GIT_REPO", None)
3435
PROFILERS_ENABLED = bool(int(os.getenv("PROFILE", 0)))
36+
COMMANDSTATS_ENABLED = bool(int(os.getenv("COMMANDSTATS_ENABLED", 1)))
3537
PROFILERS = os.getenv("PROFILERS", PROFILERS_DEFAULT)
3638
MAX_PROFILERS_PER_TYPE = int(os.getenv("MAX_PROFILERS", 1))
3739
PROFILE_FREQ = os.getenv("PROFILE_FREQ", PROFILE_FREQ_DEFAULT)
@@ -99,7 +101,7 @@ def common_run_args(parser):
99101
parser.add_argument("--github_repo", type=str, default=GIT_REPO)
100102
parser.add_argument("--github_org", type=str, default=GIT_ORG)
101103
parser.add_argument("--github_sha", type=str, default=None, nargs="?", const="")
102-
parser.add_argument("--github_branch", type=str, default=None, nargs="?", const="")
104+
parser.add_argument("--github_branch", type=str, default=GIT_BRANCH)
103105
parser.add_argument("--triggering_env", type=str, default=TRIGGERING_ENV)
104106
parser.add_argument(
105107
"--module_path",
@@ -156,8 +158,8 @@ def common_run_args(parser):
156158
)
157159
parser.add_argument(
158160
"--collect_commandstats",
159-
default=False,
160-
action="store_true",
161+
type=bool,
162+
default=COMMANDSTATS_ENABLED,
161163
help="Enables commandstats collection.",
162164
)
163165
parser.add_argument(

redisbench_admin/run/common.py

Lines changed: 64 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def prepare_benchmark_parameters(
7676
username=None,
7777
private_key=None,
7878
client_ssh_port=None,
79+
redis_password=None,
7980
):
8081
command_arr = None
8182
command_str = None
@@ -98,6 +99,7 @@ def prepare_benchmark_parameters(
9899
username,
99100
private_key,
100101
client_ssh_port,
102+
redis_password,
101103
)
102104
# v0.4 spec
103105
elif type(benchmark_config[config_key]) == dict:
@@ -117,6 +119,7 @@ def prepare_benchmark_parameters(
117119
username,
118120
private_key,
119121
client_ssh_port,
122+
redis_password,
120123
)
121124
printed_command_str = command_str
122125
printed_command_arr = command_arr
@@ -146,6 +149,7 @@ def prepare_benchmark_parameters_specif_tooling(
146149
username,
147150
private_key,
148151
client_ssh_port,
152+
redis_password=None,
149153
):
150154
if "redis-benchmark" in benchmark_tool:
151155
command_arr, command_str = prepare_redis_benchmark_command(
@@ -192,6 +196,7 @@ def prepare_benchmark_parameters_specif_tooling(
192196
entry,
193197
current_workdir,
194198
cluster_api_enabled,
199+
redis_password,
195200
)
196201

197202
if "tsbs_" in benchmark_tool:
@@ -252,6 +257,7 @@ def prepare_benchmark_parameters_specif_tooling(
252257
input_data_file,
253258
isremote,
254259
cluster_api_enabled,
260+
redis_password,
255261
)
256262
if "aibench_" in benchmark_tool:
257263
input_data_file = None
@@ -520,68 +526,74 @@ def run_redis_pre_steps(benchmark_config, r, required_modules):
520526
# In case we have modules we use it's artifact version
521527
# otherwise we use redis version as artifact version
522528
version = "N/A"
529+
# run initialization commands before benchmark starts
530+
logging.info("Running initialization commands before benchmark starts.")
531+
execute_init_commands_start_time = datetime.datetime.now()
532+
execute_init_commands(benchmark_config, r)
533+
execute_init_commands_duration_seconds = (
534+
datetime.datetime.now() - execute_init_commands_start_time
535+
).seconds
536+
logging.info(
537+
"Running initialization commands took {} secs.".format(
538+
execute_init_commands_duration_seconds
539+
)
540+
)
541+
stdout = r.execute_command("info modules")
542+
(
543+
module_names,
544+
artifact_versions,
545+
) = extract_module_semver_from_info_modules_cmd(stdout)
546+
if "search" in module_names:
547+
logging.info(
548+
"Detected redisearch module. Ensuring all indices are indexed prior benchmark"
549+
)
550+
search_specific_init(r, module_names)
523551
if required_modules is not None and len(required_modules) > 0:
524-
stdout = r.execute_command("info modules")
525-
(
526-
module_names,
527-
artifact_versions,
528-
) = extract_module_semver_from_info_modules_cmd(stdout)
552+
529553
check_required_modules(module_names, required_modules)
530-
# run initialization commands before benchmark starts
531-
logging.info("Running initialization commands before benchmark starts.")
532-
execute_init_commands_start_time = datetime.datetime.now()
533-
execute_init_commands(benchmark_config, r)
534-
execute_init_commands_duration_seconds = (
535-
datetime.datetime.now() - execute_init_commands_start_time
536-
).seconds
554+
555+
version = artifact_versions[0]
556+
else:
557+
version = r.info("server")["redis_version"]
558+
559+
return version
560+
561+
562+
def search_specific_init(r, module_names):
563+
if "search" in module_names:
537564
logging.info(
538-
"Running initialization commands took {} secs.".format(
539-
execute_init_commands_duration_seconds
540-
)
565+
"Given redisearch was detected, checking for any index that is still indexing."
541566
)
542-
if "search" in module_names:
567+
loading_indices = r.execute_command("ft._list")
568+
logging.info("Detected {} indices.".format(len(loading_indices)))
569+
while len(loading_indices) > 0:
543570
logging.info(
544-
"Given redisearch was detected, checking for any index that is still indexing."
571+
"There are still {} indices loading. {}".format(
572+
len(loading_indices), loading_indices
573+
)
545574
)
546-
loading_indices = r.execute_command("ft._list")
547-
logging.info("Detected {} indices.".format(len(loading_indices)))
548-
while len(loading_indices) > 0:
575+
for index_pos, fts_indexname in enumerate(loading_indices, start=0):
576+
if type(fts_indexname) == bytes:
577+
fts_indexname = fts_indexname.decode()
578+
ft_info = r.execute_command("ft.info {}".format(fts_indexname))
579+
is_indexing = None
580+
percent_indexed = "0.0"
581+
for arraypos, arrayval in enumerate(ft_info, start=0):
582+
if arrayval == b"percent_indexed" or arrayval == "percent_indexed":
583+
percent_indexed = ft_info[arraypos + 1]
584+
if arrayval == b"indexing" or arrayval == "indexing":
585+
is_indexing = ft_info[arraypos + 1]
586+
549587
logging.info(
550-
"There are still {} indices loading. {}".format(
551-
len(loading_indices), loading_indices
588+
"indexing={} ; percent_indexed={}.".format(
589+
is_indexing, percent_indexed
552590
)
553591
)
554-
for index_pos, fts_indexname in enumerate(loading_indices, start=0):
555-
if type(fts_indexname) == bytes:
556-
fts_indexname = fts_indexname.decode()
557-
ft_info = r.execute_command("ft.info {}".format(fts_indexname))
558-
is_indexing = None
559-
percent_indexed = "0.0"
560-
for arraypos, arrayval in enumerate(ft_info, start=0):
561-
if (
562-
arrayval == b"percent_indexed"
563-
or arrayval == "percent_indexed"
564-
):
565-
percent_indexed = ft_info[arraypos + 1]
566-
if arrayval == b"indexing" or arrayval == "indexing":
567-
is_indexing = ft_info[arraypos + 1]
568-
569-
logging.info(
570-
"indexing={} ; percent_indexed={}.".format(
571-
is_indexing, percent_indexed
572-
)
573-
)
574-
if is_indexing == "0" or is_indexing == b"0" or is_indexing == 0:
575-
loading_indices.pop(index_pos)
592+
if is_indexing == "0" or is_indexing == b"0" or is_indexing == 0:
593+
loading_indices.pop(index_pos)
576594

577-
time.sleep(5)
578-
logging.info("Loaded all secondary indices.")
579-
580-
version = artifact_versions[0]
581-
else:
582-
version = r.info("server")["redis_version"]
583-
584-
return version
595+
time.sleep(5)
596+
logging.info("Loaded all secondary indices.")
585597

586598

587599
def dso_check(dso, local_module_file):

0 commit comments

Comments
 (0)