Skip to content

Commit 3fa7475

Browse files
Extra logging on exporter_create_ts() (#263)
* Bumping version from 0.6.3 to 0.6.4 * Extra logging on exporter_create_ts()
1 parent 3b3ef4a commit 3fa7475

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
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.6.4"
3+
version = "0.6.5"
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/utils/remote.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -554,22 +554,30 @@ def exporter_create_ts(rts, time_series, timeseries_name):
554554
)
555555
)
556556
rts.create(timeseries_name, labels=time_series["labels"])
557-
except redis.exceptions.ResponseError:
558-
logging.debug(
559-
"Timeseries named {} already exists. Checking that the labels match.".format(
560-
timeseries_name
557+
except redis.exceptions.ResponseError as e:
558+
if "already exists" in e.__str__():
559+
logging.debug(
560+
"Timeseries named {} already exists. Checking that the labels match.".format(
561+
timeseries_name
562+
)
561563
)
562-
)
563-
set1 = set(time_series["labels"].items())
564-
set2 = set(rts.info(timeseries_name).labels.items())
565-
if len(set1 - set2) > 0 or len(set2 - set1) > 0:
566-
logging.info(
567-
"Given the labels don't match using TS.ALTER on {} to update labels to {}".format(
568-
timeseries_name, time_series["labels"]
564+
set1 = set(time_series["labels"].items())
565+
set2 = set(rts.info(timeseries_name).labels.items())
566+
if len(set1 - set2) > 0 or len(set2 - set1) > 0:
567+
logging.info(
568+
"Given the labels don't match using TS.ALTER on {} to update labels to {}".format(
569+
timeseries_name, time_series["labels"]
570+
)
571+
)
572+
rts.alter(timeseries_name, labels=time_series["labels"])
573+
pass
574+
else:
575+
logging.error(
576+
"While creating timeseries named {} with the following labels: {} this error ocurred: {}".format(
577+
timeseries_name, time_series["labels"], e.__str__()
569578
)
570579
)
571-
rts.alter(timeseries_name, labels=time_series["labels"])
572-
pass
580+
raise
573581

574582

575583
def extract_redisgraph_version_from_resultdict(results_dict: dict):

0 commit comments

Comments
 (0)