Skip to content

Commit 7406517

Browse files
Added --architecture flag to the export command logic (#451)
Co-authored-by: fcostaoliveira <[email protected]>
1 parent c64a62d commit 7406517

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.11.35"
3+
version = "0.11.37"
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 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "README.md"

redisbench_admin/export/args.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
# All rights reserved.
55
#
66
import datetime
7-
7+
import os
88
from redisbench_admin.utils.remote import (
99
PERFORMANCE_RTS_HOST,
1010
PERFORMANCE_RTS_PORT,
1111
PERFORMANCE_RTS_AUTH,
1212
)
1313

14+
ARCH_X86 = "x86_64"
15+
ARCH_ARM = "aarch64"
16+
VALID_ARCHS = [ARCH_X86, ARCH_ARM]
17+
ARCH = os.getenv("ARCH", ARCH_X86)
18+
1419

1520
def create_export_arguments(parser):
1621
parser.add_argument(
@@ -19,6 +24,13 @@ def create_export_arguments(parser):
1924
required=True,
2025
help="benchmark results file to read results from.",
2126
)
27+
parser.add_argument(
28+
"--architecture",
29+
type=str,
30+
required=False,
31+
default=ARCH,
32+
help=f"Architecture to run the benchmark on. One of {VALID_ARCHS}.",
33+
)
2234
parser.add_argument(
2335
"--exporter-spec-file",
2436
type=str,

redisbench_admin/export/export.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,19 @@ def export_command_logic(args, project_name, project_version):
7777
_,
7878
_,
7979
) = get_defaults(exporter_spec_file)
80+
arch = args.architecture
81+
logging.info("Using the following architecture on the timeseries: {}".format(arch))
8082

8183
extra_tags_dict = split_tags_string(args.extra_tags)
84+
if "results_format" not in extra_tags_dict:
85+
extra_tags_dict["results_format"] = results_format
86+
logging.info(f"Adding results_format={results_format} to extra tags")
87+
if "arch" not in extra_tags_dict:
88+
extra_tags_dict["arch"] = arch
89+
logging.info(f"Adding arch={arch} to extra tags")
90+
if "architecture" not in extra_tags_dict:
91+
extra_tags_dict["architecture"] = arch
92+
logging.info(f"Adding architecture={arch} to extra tags")
8293
logging.info("Using the following extra tags: {}".format(extra_tags_dict))
8394

8495
results_dict = {}
@@ -161,6 +172,7 @@ def export_command_logic(args, project_name, project_version):
161172
github_org,
162173
github_repo,
163174
triggering_env,
175+
arch,
164176
)
165177
logging.info("Parsed a total of {} metrics".format(len(timeseries_dict.keys())))
166178
logging.info(
@@ -221,6 +233,7 @@ def export_json_to_timeseries_dict(
221233
tf_github_org,
222234
tf_github_repo,
223235
triggering_env,
236+
arch,
224237
):
225238
results_dict = {}
226239
for test_name, d in benchmark_file.items():
@@ -245,6 +258,7 @@ def export_json_to_timeseries_dict(
245258
tf_github_repo,
246259
triggering_env,
247260
False,
261+
arch,
248262
)
249263
results_dict[ts_name] = {
250264
"labels": timeserie_tags.copy(),

tests/test_export.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def test_export_command_logic_google_benchmark():
161161
"{}".format(rts_pass),
162162
"--github_branch",
163163
"branch-feature-1",
164+
"--architecture",
165+
"x86_64",
164166
]
165167
)
166168
try:

0 commit comments

Comments
 (0)