diff --git a/pyproject.toml b/pyproject.toml index 791b3ea..4c41c65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisbench-admin" -version = "0.5.24" +version = "0.5.25" description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )." authors = ["filipecosta90 ","Redis Performance Group "] readme = "README.md" diff --git a/redisbench_admin/run/common.py b/redisbench_admin/run/common.py index af49250..0572c1c 100644 --- a/redisbench_admin/run/common.py +++ b/redisbench_admin/run/common.py @@ -238,6 +238,15 @@ def common_exporter_logic( datapoints_timestamp = parse_exporter_timemetric( exporter_timemetric_path, results_dict ) + if datapoints_timestamp is None: + datapoints_timestamp = int( + datetime.datetime.now(datetime.timezone.utc).timestamp() * 1000.0 + ) + logging.warning( + "Error while trying to parse datapoints timestamp. Using current system timestamp Error: {}".format( + datapoints_timestamp + ) + ) if ( artifact_version is not None and artifact_version != "" diff --git a/redisbench_admin/run/ycsb/ycsb.py b/redisbench_admin/run/ycsb/ycsb.py index 3d115a7..125e2ff 100644 --- a/redisbench_admin/run/ycsb/ycsb.py +++ b/redisbench_admin/run/ycsb/ycsb.py @@ -26,7 +26,22 @@ def prepare_ycsb_benchmark_command( workload = None threads = None override_workload_properties = [] - for k in benchmark_config["parameters"]: + if type(benchmark_config["parameters"]) == list: + for k in benchmark_config["parameters"]: + if "database" in k: + database = k["database"] + if "step" in k: + step = k["step"] + if "workload" in k: + workload = k["workload"] + if current_workdir is not None and workload.startswith("./"): + workload = "{}{}".format(current_workdir, workload[1:]) + if "threads" in k: + threads = k["threads"] + if "override_workload_properties" in k: + override_workload_properties = k["override_workload_properties"] + if type(benchmark_config["parameters"]) == dict: + k = benchmark_config["parameters"] if "database" in k: database = k["database"] if "step" in k: @@ -47,9 +62,10 @@ def prepare_ycsb_benchmark_command( if threads: command_arr.extend(["-p", '"threadcount={}"'.format(threads)]) - command_arr.extend(["-p", '"redis.host={}"'.format(server_private_ip)]) - - command_arr.extend(["-p", '"redis.port={}"'.format(server_plaintext_port)]) + if server_private_ip is not None: + command_arr.extend(["-p", '"redis.host={}"'.format(server_private_ip)]) + if server_plaintext_port is not None: + command_arr.extend(["-p", '"redis.port={}"'.format(server_plaintext_port)]) for prop in override_workload_properties: for k, v in prop.items(): diff --git a/redisbench_admin/run_remote/run_remote.py b/redisbench_admin/run_remote/run_remote.py index 75bb93c..4aeabef 100644 --- a/redisbench_admin/run_remote/run_remote.py +++ b/redisbench_admin/run_remote/run_remote.py @@ -614,7 +614,13 @@ def run_remote_command_logic(args, project_name, project_version): setup_name, test_name, ) - + except KeyboardInterrupt: + logging.critical( + "Detected Keyboard interruput...Destroy all remote envs and exiting right away!" + ) + if args.inventory is None: + terraform_destroy(remote_envs) + exit(1) except: ( start_time, diff --git a/redisbench_admin/utils/benchmark_config.py b/redisbench_admin/utils/benchmark_config.py index b287913..9fce499 100644 --- a/redisbench_admin/utils/benchmark_config.py +++ b/redisbench_admin/utils/benchmark_config.py @@ -39,7 +39,9 @@ def parse_exporter_timemetric(metric_path: str, results_dict: dict): datapoints_timestamp = None try: jsonpath_expr = parse(metric_path) - datapoints_timestamp = int(jsonpath_expr.find(results_dict)[0].value) + find_res = jsonpath_expr.find(results_dict) + if len(find_res) > 0: + datapoints_timestamp = int(find_res[0].value) except Exception as e: logging.error( "Unable to parse time-metric {}. Error: {}".format(metric_path, e.__str__()) diff --git a/redisbench_admin/utils/remote.py b/redisbench_admin/utils/remote.py index 4e26fe7..afbce37 100644 --- a/redisbench_admin/utils/remote.py +++ b/redisbench_admin/utils/remote.py @@ -505,7 +505,6 @@ def fetch_remote_setup_from_config( def push_data_to_redistimeseries(rts, time_series_dict: dict): - logging.info(time_series_dict) datapoint_errors = 0 datapoint_inserts = 0 if rts is not None and time_series_dict is not None: