diff --git a/pyproject.toml b/pyproject.toml index 19eb630..d99f34f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisbench-admin" -version = "0.11.35" +version = "0.11.37" 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/export/args.py b/redisbench_admin/export/args.py index 225e064..7f541d6 100644 --- a/redisbench_admin/export/args.py +++ b/redisbench_admin/export/args.py @@ -4,13 +4,18 @@ # All rights reserved. # import datetime - +import os from redisbench_admin.utils.remote import ( PERFORMANCE_RTS_HOST, PERFORMANCE_RTS_PORT, PERFORMANCE_RTS_AUTH, ) +ARCH_X86 = "x86_64" +ARCH_ARM = "aarch64" +VALID_ARCHS = [ARCH_X86, ARCH_ARM] +ARCH = os.getenv("ARCH", ARCH_X86) + def create_export_arguments(parser): parser.add_argument( @@ -19,6 +24,13 @@ def create_export_arguments(parser): required=True, help="benchmark results file to read results from.", ) + parser.add_argument( + "--architecture", + type=str, + required=False, + default=ARCH, + help=f"Architecture to run the benchmark on. One of {VALID_ARCHS}.", + ) parser.add_argument( "--exporter-spec-file", type=str, diff --git a/redisbench_admin/export/export.py b/redisbench_admin/export/export.py index 761c7e0..34289dc 100644 --- a/redisbench_admin/export/export.py +++ b/redisbench_admin/export/export.py @@ -77,8 +77,19 @@ def export_command_logic(args, project_name, project_version): _, _, ) = get_defaults(exporter_spec_file) + arch = args.architecture + logging.info("Using the following architecture on the timeseries: {}".format(arch)) extra_tags_dict = split_tags_string(args.extra_tags) + if "results_format" not in extra_tags_dict: + extra_tags_dict["results_format"] = results_format + logging.info(f"Adding results_format={results_format} to extra tags") + if "arch" not in extra_tags_dict: + extra_tags_dict["arch"] = arch + logging.info(f"Adding arch={arch} to extra tags") + if "architecture" not in extra_tags_dict: + extra_tags_dict["architecture"] = arch + logging.info(f"Adding architecture={arch} to extra tags") logging.info("Using the following extra tags: {}".format(extra_tags_dict)) results_dict = {} @@ -161,6 +172,7 @@ def export_command_logic(args, project_name, project_version): github_org, github_repo, triggering_env, + arch, ) logging.info("Parsed a total of {} metrics".format(len(timeseries_dict.keys()))) logging.info( @@ -221,6 +233,7 @@ def export_json_to_timeseries_dict( tf_github_org, tf_github_repo, triggering_env, + arch, ): results_dict = {} for test_name, d in benchmark_file.items(): @@ -245,6 +258,7 @@ def export_json_to_timeseries_dict( tf_github_repo, triggering_env, False, + arch, ) results_dict[ts_name] = { "labels": timeserie_tags.copy(), diff --git a/tests/test_export.py b/tests/test_export.py index 6f75d1f..b76141a 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -161,6 +161,8 @@ def test_export_command_logic_google_benchmark(): "{}".format(rts_pass), "--github_branch", "branch-feature-1", + "--architecture", + "x86_64", ] ) try: