From b3bb9e3c5a96ac62fe5d5d0a0af116fc3aa58fbd Mon Sep 17 00:00:00 2001 From: Jean-Didier Totow Date: Mon, 19 Apr 2021 17:30:15 +0300 Subject: [PATCH 1/3] upgrade stomp to version 7 --- .../database/data/meta/meta.db | Bin 148 -> 178 bytes .../database/entrypoint.sh | 2 +- .../inputapi/src/activemqlistermanager.py | 16 +- .../database/inputapi/src/app.py | 1 - .../dataset-builder/datasets/demo.csv | 284 ++---------------- .../docker-compose.yaml | 2 + .../example/influxdb_querier.py | 2 +- .../example/publisher.py | 3 +- .../example/subscriber.py | 10 +- 9 files changed, 45 insertions(+), 275 deletions(-) diff --git a/morphemic-persistent-storage/database/data/meta/meta.db b/morphemic-persistent-storage/database/data/meta/meta.db index cfa772e05ee150b92492c912a03600ba77b07d97..1ffc2dba105f54095bffb34565de252b010024af 100644 GIT binary patch delta 111 zcmbQjxQS7KgF%2*;$`Ea)t@#W=oi=WnkXP@YQn{ySXz>wo|-4XAkomUq{bug~uhQ((|y;$WI+V=ar2`m^Kf@0+_JQj8W14on_Q E02x~<9{>OV delta 81 zcmdnQIE7JwgF%2r;(N=N4R@~m+8d#zGf_ZPT#So7v9u&VJvC2&L875y$;tl*I~f%i lCq`Mz9{F=|?T;N|K+%Tw*$q8A#S|E{m^c_M7#tWq7y Date: Fri, 23 Apr 2021 10:57:57 +0300 Subject: [PATCH 2/3] code optimization --- morphemic-persistent-storage/database/inputapi/src/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/morphemic-persistent-storage/database/inputapi/src/app.py b/morphemic-persistent-storage/database/inputapi/src/app.py index 01a151a4..3e7755b1 100644 --- a/morphemic-persistent-storage/database/inputapi/src/app.py +++ b/morphemic-persistent-storage/database/inputapi/src/app.py @@ -420,7 +420,7 @@ class Ingestor(Thread): fields = json.loads(content) except Exception as e: print("Cannot decode json") - print("content", content) + #print("content", content) return False # self.tolerance_manager.addTime(fields["application"], fields["timestamp"]) application = fields[metric_name_field_application] @@ -468,7 +468,7 @@ class Ingestor(Thread): except Exception as e: print("An Error occur while inserting data point") print(e) - print("content", point) + #print("content", point) return False -- GitLab From 4d7804e0220e26302f396d88685a42abc40622fc Mon Sep 17 00:00:00 2001 From: Jean-Didier Totow Date: Fri, 23 Apr 2021 11:01:40 +0300 Subject: [PATCH 3/3] datasetlib bug fix --- morphemic-datasetmaker/morphemic/dataset/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/morphemic-datasetmaker/morphemic/dataset/__init__.py b/morphemic-datasetmaker/morphemic/dataset/__init__.py index db2c96f2..a8a477df 100644 --- a/morphemic-datasetmaker/morphemic/dataset/__init__.py +++ b/morphemic-datasetmaker/morphemic/dataset/__init__.py @@ -10,7 +10,11 @@ class Row(): self.features = features if "time" in self.features: time_str = self.features["time"] - _obj = datetime.strptime(time_str,'%Y-%m-%dT%H:%M:%S.%fZ') + _obj = None + try: + _obj = datetime.strptime(time_str,'%Y-%m-%dT%H:%M:%S.%fZ') + except: + _obj = datetime.strptime(time_str,'%Y-%m-%dT%H:%M:%SZ') self.features["time"] = int(_obj.timestamp()) if 'application' in metricsname: metricsname.remove('application') @@ -18,6 +22,7 @@ class Row(): if not field_name in self.features: self.features[field_name] = None + def getTime(self): if "time" in self.features: return self.features["time"] -- GitLab