Skip to content

Commit 09525be

Browse files
Fixed the --extra-tags export logic (#225)
* [fix] Fixed the --extra-tags export logic * Bumping version from 0.5.7 to 0.5.8
1 parent 0e50b6b commit 09525be

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
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.5.7"
3+
version = "0.5.8"
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/common/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ def add_datapoint(
4848

4949

5050
def split_tags_string(extra_tags):
51-
result = []
51+
result = {}
5252
extra_tags = extra_tags.split(",")
5353
if len(extra_tags) > 0:
5454
for extra_tag in extra_tags:
5555
kv = extra_tag.split("=")
5656
if len(kv) == 2:
5757
k = prepare_tags(kv[0])
5858
v = prepare_tags(kv[1])
59-
result.append({k: v})
59+
result[k] = v
6060
return result
6161

6262

redisbench_admin/export/export.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,7 @@ def export_command_logic(args, project_name, project_version):
3737
if results_format == "json":
3838
with open(benchmark_file, "r") as json_file:
3939
results_dict = json.load(json_file)
40-
extra_tags_array = split_tags_string(args.extra_tags)
41-
extra_tags_dict = {}
42-
for kv_pair in extra_tags_array:
43-
kv_tuple = kv_pair.split("=")
44-
if len(kv_tuple) < 2:
45-
pass
46-
key = kv_tuple[0]
47-
value = kv_tuple[1]
48-
extra_tags_dict[key] = value
40+
extra_tags_dict = split_tags_string(args.extra_tags)
4941
logging.info("Using the following extra tags: {}".format(extra_tags_dict))
5042

5143
logging.info("Checking connection to RedisTimeSeries.")

tests/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_add_datapoint(self):
5656

5757
def test_split_tags_string(self):
5858
result = split_tags_string("k1=v1,k2=v2")
59-
assert result == [{"k1": "v1"}, {"k2": "v2"}]
59+
assert result == {"k1": "v1", "k2": "v2"}
6060

6161
def test_get_or_none(self):
6262
res = get_or_none({}, "k")

0 commit comments

Comments
 (0)