diff --git a/morphemic-datasetmaker/morphemic/dataset/__init__.py b/morphemic-datasetmaker/morphemic/dataset/__init__.py index b19e48b3af4f0a9ff08e7c27a4e7c8bf0f333fc9..a8a477dfc2634053e952c749b71507ff41a80825 100644 --- a/morphemic-datasetmaker/morphemic/dataset/__init__.py +++ b/morphemic-datasetmaker/morphemic/dataset/__init__.py @@ -22,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"] diff --git a/morphemic-persistent-storage/database/data/meta/meta.db b/morphemic-persistent-storage/database/data/meta/meta.db index cfa772e05ee150b92492c912a03600ba77b07d97..1ffc2dba105f54095bffb34565de252b010024af 100644 Binary files a/morphemic-persistent-storage/database/data/meta/meta.db and b/morphemic-persistent-storage/database/data/meta/meta.db differ diff --git a/morphemic-persistent-storage/database/entrypoint.sh b/morphemic-persistent-storage/database/entrypoint.sh index 259480d1a17df8e55c08ce0e826da54ec7258e44..1f8135ec544c7db4688c2579d8460972c7188f47 100755 --- a/morphemic-persistent-storage/database/entrypoint.sh +++ b/morphemic-persistent-storage/database/entrypoint.sh @@ -10,7 +10,7 @@ if [ "$1" = 'influxd' ]; then fi # Run API -python inputapi/app.py & +python -u inputapi/app.py & # Run InfluxDB exec "$@" diff --git a/morphemic-persistent-storage/database/inputapi/src/activemqlistermanager.py b/morphemic-persistent-storage/database/inputapi/src/activemqlistermanager.py index d9cffc516202d0031e7eed20df2bc2031c9e29df..542c15dbb462463a5e1ab592b73a07fd35d7ef92 100644 --- a/morphemic-persistent-storage/database/inputapi/src/activemqlistermanager.py +++ b/morphemic-persistent-storage/database/inputapi/src/activemqlistermanager.py @@ -11,11 +11,11 @@ class Listener(object): self.handler = handler self.start = time.time() - def on_error(self, headers, message): - print("received an error %s" % message) + def on_error(self, frame): + print("received an error %s" % frame.body) - def on_message(self, headers, message): - self.handler(message) + def on_message(self, frame): + self.handler(frame.body) class Worker(Thread): @@ -78,8 +78,8 @@ class ActiveMQManager: def __init__(self, handler): self.all_threads = [] self.handler = handler - thread_controller = Thread(target=self.workerController) - thread_controller.start() + self.thread_controller = Thread(target=self.workerController) + self.thread_controller.start() def getData(self, data): if data_format == "json": @@ -96,8 +96,8 @@ class ActiveMQManager: print("Worker controller started") while True: for w in self.all_threads: - if w.getStatus() == "stopped" or w.getStatus() == "error": - w.stop() + if not w.is_alive() or w.getStatus() == "stopped" or w.getStatus() == "error": + #w.stop() print("Worker {0} will restart in 5 seconds".format(w.getIndex())) time.sleep(5) w.start() diff --git a/morphemic-persistent-storage/database/inputapi/src/app.py b/morphemic-persistent-storage/database/inputapi/src/app.py index 9b63405b9621fd1ee2e5a7fc54a76a82422ede99..3e7755b15cec9adbea8c101165866846cbae11fd 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 @@ -630,7 +630,6 @@ class InputApi: self.handleRequest(_json) return True except Exception as e: - print(e) print("Non JSON content received") return None self.ingestor.addToList(data) diff --git a/morphemic-persistent-storage/dataset-builder/datasets/demo.csv b/morphemic-persistent-storage/dataset-builder/datasets/demo.csv index 81c70a4fbe295c5819783ebe9831989576304dd4..bb4309ff6ffbc9090b6a8e5403bb7e7fc477293d 100644 --- a/morphemic-persistent-storage/dataset-builder/datasets/demo.csv +++ b/morphemic-persistent-storage/dataset-builder/datasets/demo.csv @@ -1,258 +1,28 @@ time,cpu_usage,latency,level,memory,response_time -1614276292,9.906976744186046,99.75999999999999,1,14.720930232558139,344 -1614276297,9.329113924050633,45.82,1,24.9873417721519,158 -1614276303,4.90625,74.24,1,21.71875,256 -1614276308,12.496503496503497,82.94,1,12.48951048951049,286 -1614276313,8.688172043010752,107.88,1,9.064516129032258,372 -1614276318,13.26797385620915,88.74,1,13.803921568627452,306 -1614276323,7.577319587628866,112.52,1,11.731958762886599,388 -1614276328,9.623188405797102,80.03999999999999,1,20.869565217391305,276 -1614276333,12.816793893129772,75.97999999999999,1,15.450381679389313,262 -1614276338,5.840909090909091,102.08,1,9.522727272727273,352 -1614276343,7.26797385620915,88.74,1,16.80392156862745,306 -1614276348,6.378378378378379,85.83999999999999,1,12.135135135135135,296 -1614276353,6.03030303030303,95.69999999999999,1,10.090909090909092,330 -1614276358,9.05050505050505,57.419999999999995,1,25.151515151515152,198 -1614276363,8.329113924050633,45.82,1,28.9873417721519,158 -1614276368,7.181347150259067,55.97,1,21.5440414507772,193 -1614276373,13.367003367003367,86.13,1,20.1010101010101,297 -1614276378,9.690036900369003,78.58999999999999,1,17.070110701107012,271 -1614276383,4.5188916876574305,115.13,1,8.556675062972293,397 -1614276388,10.246376811594203,40.019999999999996,1,25.73913043478261,138 -1614276393,10.5662100456621,63.51,1,16.698630136986303,219 -1614276398,12.620689655172415,33.64,1,29.862068965517242,116 -1614276403,6.219409282700422,68.72999999999999,1,21.658227848101266,237 -1614276408,14.8125,37.12,1,27.4375,128 -1614276413,8.754820936639119,105.27,1,10.264462809917354,363 -1614276418,10.52112676056338,82.36,1,16.56338028169014,284 -1614276423,3.6666666666666665,108.74999999999999,1,17.0,375 -1614276428,14.545454545454547,63.8,1,20.636363636363637,220 -1614276433,10.666666666666666,108.74999999999999,1,17.0,375 -1614276438,9.278688524590164,88.44999999999999,1,10.836065573770492,305 -1614276443,15.620689655172415,33.64,1,35.86206896551724,116 -1614276448,16.41025641025641,45.239999999999995,1,23.23076923076923,156 -1614276453,8.311258278145695,87.58,1,19.933774834437088,302 -1614276458,10.590673575129534,111.94,1,9.7720207253886,386 -1614276463,8.690036900369003,78.58999999999999,1,16.070110701107012,271 -1614276468,4.808988764044944,103.24,1,16.426966292134832,356 -1614276473,13.849557522123893,32.769999999999996,1,32.54867256637168,113 -1614276478,16.46268656716418,38.86,1,29.388059701492537,134 -1614276483,5.710027100271002,107.00999999999999,1,15.130081300813009,369 -1614276488,4.460207612456747,83.80999999999999,1,12.380622837370241,289 -1614276493,13.928571428571429,32.48,1,29.785714285714285,112 -1614276498,16.25925925925926,31.319999999999997,1,28.77777777777778,108 -1614276503,7.525252525252525,114.83999999999999,1,8.575757575757576,396 -1614276508,9.878048780487806,59.449999999999996,1,16.634146341463413,205 -1614276513,12.936507936507937,36.54,1,28.80952380952381,126 -1614276518,12.164556962025316,91.64,1,18.49367088607595,316 -1614276523,10.604166666666666,111.35999999999999,1,17.8125,384 -1614276528,11.702702702702702,107.3,1,13.108108108108109,370 -1614276533,9.34448160535117,86.71,1,14.033444816053512,299 -1614276538,12.407407407407408,39.15,1,30.22222222222222,135 -1614276543,7.739336492890995,61.19,1,21.218009478672986,211 -1614276548,10.012048192771084,96.27999999999999,1,14.036144578313253,332 -1614276553,7.944444444444445,41.76,1,30.833333333333332,144 -1614276558,9.444444444444445,65.25,1,16.333333333333336,225 -1614276563,10.91545189504373,99.47,1,10.746355685131196,343 -1614276568,10.19672131147541,35.379999999999995,1,26.59016393442623,122 -1614276573,17.352941176470587,39.44,1,31.058823529411764,136 -1614276578,10.832861189801699,102.36999999999999,1,14.498583569405099,353 -1614276583,4.322259136212624,87.28999999999999,1,15.966777408637874,301 -1614276588,8.703703703703704,78.3,1,12.11111111111111,270 -1614276593,8.976190476190476,97.44,1,18.92857142857143,336 -1614276598,5.840909090909091,102.08,1,14.522727272727273,352 -1614276604,19.0,28.999999999999996,1,40.0,100 -1614276609,6.25531914893617,68.14999999999999,1,20.76595744680851,235 -1614276614,8.703703703703704,78.3,1,18.11111111111111,270 -1614276619,10.577319587628866,112.52,1,12.731958762886599,388 -1614276624,12.215434083601286,90.19,1,16.646302250803856,311 -1614276629,10.5,115.99999999999999,1,12.5,400 -1614276634,9.219409282700422,68.72999999999999,1,13.658227848101266,237 -1614276639,6.291005291005291,54.809999999999995,1,23.873015873015873,189 -1614276644,13.115264797507788,93.08999999999999,1,12.345794392523365,321 -1614276649,4.604166666666666,111.35999999999999,1,16.8125,384 -1614276653,12.555555555555555,52.199999999999996,1,24.666666666666668,180 -1614276658,6.081632653061225,71.05,1,16.244897959183675,245 -1614276663,7.5188916876574305,115.13,1,12.556675062972293,397 -1614276668,7.25531914893617,68.14999999999999,1,22.76595744680851,235 -1614276673,12.754820936639119,105.27,1,11.264462809917354,363 -1614276678,10.347826086956522,66.69999999999999,1,18.043478260869563,230 -1614276683,13.636363636363637,79.75,1,20.909090909090907,275 -1614276688,7.105590062111801,93.38,1,11.316770186335404,322 -1614276693,9.531645569620252,114.55,1,16.594936708860757,395 -1614276698,9.41296928327645,84.97,1,16.238907849829353,293 -1614276703,10.115264797507788,93.08999999999999,1,16.345794392523366,321 -1614276708,11.597122302158272,80.61999999999999,1,18.79136690647482,278 -1614276713,7.62962962962963,62.63999999999999,1,16.88888888888889,216 -1614276718,13.278688524590164,88.44999999999999,1,15.836065573770492,305 -1614276723,4.289473684210526,88.16,1,11.868421052631579,304 -1614276728,12.184713375796179,91.05999999999999,1,19.554140127388536,314 -1614276733,9.98406374501992,72.78999999999999,1,19.95219123505976,251 -1614276738,12.424778761061948,65.53999999999999,1,17.27433628318584,226 -1614276743,8.846153846153847,75.39999999999999,1,21.53846153846154,260 -1614276748,11.493506493506494,44.66,1,24.48051948051948,154 -1614276753,5.67379679144385,108.46,1,13.02139037433155,374 -1614276758,14.299270072992702,39.73,1,28.8978102189781,137 -1614276763,18.620689655172413,33.64,1,29.862068965517242,116 -1614276768,8.3003300330033,87.86999999999999,1,18.900990099009903,303 -1614276773,11.717391304347826,106.72,1,11.152173913043478,368 -1614276778,14.369426751592357,45.529999999999994,1,20.10828025477707,157 -1614276783,10.201680672268907,69.02,1,15.605042016806722,238 -1614276788,6.347593582887701,54.23,1,22.0427807486631,187 -1614276793,6.546099290780141,81.78,1,18.638297872340424,282 -1614276798,7.434782608695652,53.36,1,20.304347826086957,184 -1614276803,7.645502645502646,109.61999999999999,1,14.936507936507937,378 -1614276808,10.508771929824562,82.64999999999999,1,18.526315789473685,285 -1614276813,4.773584905660377,76.85,1,14.320754716981131,265 -1614276818,11.128205128205128,56.55,1,23.384615384615387,195 -1614276823,13.128205128205128,56.55,1,22.384615384615387,195 -1614276828,8.289473684210526,88.16,1,17.86842105263158,304 -1614276833,8.545454545454547,63.8,1,22.636363636363637,220 -1614276838,11.448275862068964,84.1,1,17.344827586206897,290 -1614276843,10.030303030303031,95.69999999999999,1,13.090909090909092,330 -1614276848,5.745318352059925,77.42999999999999,1,21.235955056179776,267 -1614276853,12.264462809917354,35.089999999999996,1,33.79338842975207,121 -1614276858,14.154639175257731,56.26,1,25.463917525773198,194 -1614276863,6.555555555555555,52.199999999999996,1,19.666666666666668,180 -1614276868,11.906976744186046,99.75999999999999,1,17.72093023255814,344 -1614276873,5.03951367781155,95.41,1,16.118541033434653,329 -1614276878,12.91715976331361,49.01,1,27.75147928994083,169 -1614276883,9.944444444444445,41.76,1,30.833333333333332,144 -1614276888,14.424778761061948,65.53999999999999,1,16.27433628318584,226 -1614276893,9.578947368421051,44.08,1,23.736842105263158,152 -1614276899,7.181347150259067,55.97,1,21.5440414507772,193 -1614276904,4.610966057441253,111.07,1,16.83289817232376,383 -1614276909,10.448275862068964,84.1,1,18.344827586206897,290 -1614276914,11.608294930875577,62.92999999999999,1,20.824884792626726,217 -1614276919,7.225806451612903,89.89999999999999,1,15.67741935483871,310 -1614276924,12.367003367003367,86.13,1,13.1010101010101,297 -1614276929,12.847953216374268,49.589999999999996,1,26.54385964912281,171 -1614276934,9.064516129032258,35.96,1,32.193548387096776,124 -1614276939,9.846153846153847,75.39999999999999,1,15.538461538461538,260 -1614276944,8.91715976331361,49.01,1,21.75147928994083,169 -1614276949,9.777777777777779,104.39999999999999,1,12.333333333333334,360 -1614276954,14.608294930875577,62.92999999999999,1,16.824884792626726,217 -1614276959,8.714285714285715,50.75,1,20.142857142857142,175 -1614276964,4.638522427440633,109.91,1,13.915567282321899,379 -1614276969,9.389830508474576,85.55,1,15.169491525423728,295 -1614276974,11.3003300330033,87.86999999999999,1,16.900990099009903,303 -1614276979,14.993006993006993,41.47,1,27.97902097902098,143 -1614276984,11.816793893129772,75.97999999999999,1,12.450381679389313,262 -1614276989,13.584229390681003,80.91,1,15.75268817204301,279 -1614276994,9.097560975609756,47.559999999999995,1,21.29268292682927,164 -1614276999,11.237288135593221,68.44,1,21.71186440677966,236 -1614277004,14.714285714285715,50.75,1,18.142857142857142,175 -1614277009,11.181347150259068,55.97,1,17.5440414507772,193 -1614277014,8.558718861209965,81.49,1,14.676156583629894,281 -1614277019,4.610966057441253,111.07,1,16.83289817232376,383 -1614277024,8.367003367003367,86.13,1,19.1010101010101,297 -1614277029,8.802721088435373,42.629999999999995,1,24.408163265306122,147 -1614277034,13.504504504504505,64.38,1,22.513513513513516,222 -1614277039,13.064516129032258,35.96,1,31.193548387096776,124 -1614277044,6.716981132075472,61.48,1,24.150943396226417,212 -1614277049,5.610966057441253,111.07,1,12.832898172323759,383 -1614277054,8.787878787878789,76.55999999999999,1,12.363636363636363,264 -1614277059,6.531645569620253,114.55,1,9.594936708860759,395 -1614277064,12.73972602739726,105.85,1,11.219178082191782,365 -1614277069,7.389830508474576,85.55,1,14.169491525423728,295 -1614277074,7.149377593360996,69.89,1,19.448132780082986,241 -1614277079,12.291005291005291,54.809999999999995,1,20.873015873015873,189 -1614277083,17.936507936507937,36.54,1,30.80952380952381,126 -1614277088,4.617801047120419,110.77999999999999,1,9.853403141361255,382 -1614277093,7.086419753086419,93.96,1,16.25925925925926,324 -1614277098,5.832861189801699,102.36999999999999,1,13.498583569405099,353 -1614277103,11.246376811594203,40.019999999999996,1,25.73913043478261,138 -1614277108,12.322259136212624,87.28999999999999,1,17.966777408637874,301 -1614277113,5.067484662576687,94.53999999999999,1,10.202453987730062,326 -1614277118,10.710027100271002,107.00999999999999,1,12.130081300813009,369 -1614277123,14.615384615384615,30.159999999999997,1,30.846153846153847,104 -1614277128,7.1020408163265305,56.839999999999996,1,23.306122448979593,196 -1614277133,10.26797385620915,88.74,1,17.80392156862745,306 -1614277138,7.617801047120419,110.77999999999999,1,13.853403141361255,382 -1614277143,18.345794392523366,31.029999999999998,1,33.03738317757009,107 -1614277148,13.493506493506494,44.66,1,25.48051948051948,154 -1614277153,13.299270072992702,39.73,1,27.8978102189781,137 -1614277158,13.311258278145695,87.58,1,13.933774834437086,302 -1614277163,15.74712643678161,50.459999999999994,1,20.24137931034483,174 -1614277168,12.04225352112676,41.18,1,25.12676056338028,142 -1614277173,10.564102564102564,113.1,1,8.692307692307693,390 -1614277178,14.555555555555555,52.199999999999996,1,19.666666666666668,180 -1614277183,11.816793893129772,75.97999999999999,1,15.450381679389313,262 -1614277188,3.6595744680851063,109.03999999999999,1,9.97872340425532,376 -1614277193,12.717391304347826,106.72,1,11.152173913043478,368 -1614277198,11.824858757062147,102.66,1,17.474576271186443,354 -1614277203,12.03951367781155,95.41,1,12.118541033434651,329 -1614277209,8.310344827586206,67.28,1,14.931034482758621,232 -1614277214,10.62962962962963,62.63999999999999,1,22.88888888888889,216 -1614277219,10.950495049504951,58.58,1,23.851485148514854,202 -1614277224,3.881844380403458,100.63,1,13.645533141210375,347 -1614277229,14.474576271186441,34.22,1,33.42372881355932,118 -1614277234,10.236245954692556,89.61,1,18.70873786407767,309 -1614277239,12.291845493562231,67.57,1,13.875536480686696,233 -1614277244,11.003003003003002,96.57,1,11.00900900900901,333 -1614277249,7.610966057441253,111.07,1,17.83289817232376,383 -1614277254,9.04225352112676,41.18,1,24.12676056338028,142 -1614277259,9.154574132492113,91.92999999999999,1,14.46372239747634,317 -1614277264,4.590673575129534,111.94,1,8.7720207253886,386 -1614277269,13.032258064516128,71.92,1,15.096774193548388,248 -1614277274,4.739726027397261,105.85,1,17.21917808219178,365 -1614277279,8.205128205128204,90.47999999999999,1,19.615384615384613,312 -1614277284,7.257328990228013,89.02999999999999,1,19.77198697068404,307 -1614277289,10.299270072992702,39.73,1,28.8978102189781,137 -1614277294,12.329113924050633,45.82,1,24.9873417721519,158 -1614277299,6.132231404958677,70.17999999999999,1,20.396694214876035,242 -1614277304,5.6900369003690034,78.58999999999999,1,16.070110701107012,271 -1614277309,10.873563218390805,100.91999999999999,1,10.620689655172415,348 -1614277314,9.236245954692556,89.61,1,10.70873786407767,309 -1614277319,14.405286343612335,65.83,1,23.215859030837002,227 -1614277324,11.194244604316546,40.309999999999995,1,31.58273381294964,139 -1614277329,12.610108303249097,80.33,1,11.830324909747292,277 -1614277334,6.34448160535117,86.71,1,17.03344481605351,299 -1614277339,13.494505494505495,52.779999999999994,1,24.483516483516482,182 -1614277344,11.125,92.8,1,19.375,320 -1614277349,11.134969325153374,47.269999999999996,1,21.404907975460123,163 -1614277354,12.115264797507788,93.08999999999999,1,17.345794392523366,321 -1614277359,9.025125628140703,57.709999999999994,1,24.075376884422113,199 -1614277364,14.524886877828054,64.08999999999999,1,16.574660633484164,221 -1614277369,10.832861189801699,102.36999999999999,1,9.498583569405099,353 -1614277374,16.211180124223603,46.69,1,28.633540372670808,161 -1614277379,7.694835680751174,61.769999999999996,1,22.08450704225352,213 -1614277384,6.949852507374631,98.30999999999999,1,13.849557522123893,339 -1614277389,13.434782608695652,53.36,1,25.304347826086957,184 -1614277394,6.5188916876574305,115.13,1,16.556675062972293,397 -1614277399,8.367003367003367,86.13,1,13.1010101010101,297 -1614277404,13.291845493562231,67.57,1,20.875536480686698,233 -1614277409,5.777777777777778,104.39999999999999,1,17.333333333333336,360 -1614277414,8.11522633744856,70.47,1,20.345679012345677,243 -1614277419,12.857142857142858,101.5,1,15.571428571428571,350 -1614277424,5.784688995215311,60.60999999999999,1,15.354066985645932,209 -1614277429,11.076923076923077,94.25,1,10.23076923076923,325 -1614277434,13.58659217877095,51.91,1,17.75977653631285,179 -1614277439,10.881844380403457,100.63,1,13.645533141210375,347 -1614277444,17.0,28.999999999999996,1,39.0,100 -1614277449,12.900990099009901,29.29,1,35.70297029702971,101 -1614277454,12.832861189801699,102.36999999999999,1,18.4985835694051,353 -1614277459,11.451612903225806,44.949999999999996,1,27.35483870967742,155 -1614277464,10.090909090909092,31.9,1,37.27272727272727,110 -1614277469,15.333333333333334,34.8,1,35.0,120 -1614277474,18.695652173913043,33.349999999999994,1,32.086956521739125,115 -1614277479,13.021148036253777,95.99,1,13.06344410876133,331 -1614277484,9.132231404958677,70.17999999999999,1,18.396694214876035,242 -1614277489,10.745318352059925,77.42999999999999,1,15.235955056179776,267 -1614277494,13.424657534246576,84.67999999999999,1,15.273972602739725,292 -1614277499,11.575757575757576,38.279999999999994,1,25.727272727272727,132 -1614277504,5.652519893899204,109.33,1,13.957559681697614,377 -1614277509,5.787878787878788,76.55999999999999,1,14.363636363636363,264 -1614277515,14.854368932038835,59.739999999999995,1,19.563106796116507,206 -1614277520,8.524886877828054,64.08999999999999,1,14.574660633484163,221 -1614277525,8.967359050445104,97.72999999999999,1,10.90207715133531,337 -1614277530,7.2631578947368425,55.099999999999994,1,16.789473684210527,190 -1614277535,8.878048780487806,59.449999999999996,1,16.634146341463413,205 -1614277540,4.857142857142858,101.5,1,17.57142857142857,350 -1614277545,12.813953488372093,49.879999999999995,1,22.441860465116278,172 -1614277549,7.754820936639119,105.27,1,12.264462809917354,363 -1614277554,11.890173410404625,100.33999999999999,1,11.670520231213873,346 -1614277559,14.46268656716418,38.86,1,29.388059701492537,134 -1614277564,10.174311926605505,31.61,1,31.522935779816514,109 -1614277569,5.651162790697675,62.349999999999994,1,20.953488372093023,215 -1614277574,16.211180124223603,46.69,1,22.633540372670808,161 +1618826071,10.770083102493075,104.69,1,15.310249307479225,361 +1618826076,19.174311926605505,31.61,1,32.522935779816514,109 +1618826081,6.184100418410042,69.31,1,22.552301255230127,239 +1618826086,4.412969283276451,84.97,1,14.238907849829351,293 +1618826091,15.263157894736842,55.099999999999994,1,24.789473684210527,190 +1618826096,16.493506493506494,44.66,1,25.48051948051948,154 +1618826101,3.6455026455026456,109.61999999999999,1,15.936507936507937,378 +1618826106,5.424657534246576,84.67999999999999,1,16.273972602739725,292 +1618826111,16.25925925925926,31.319999999999997,1,36.77777777777778,108 +1618826116,10.900990099009901,29.29,1,35.70297029702971,101 +1618826121,10.025125628140703,57.709999999999994,1,25.075376884422113,199 +1618826126,5.695417789757412,107.58999999999999,1,16.086253369272235,371 +1618826131,10.710027100271002,107.00999999999999,1,13.130081300813009,369 +1618826136,13.184713375796179,91.05999999999999,1,13.554140127388536,314 +1618826141,5.205128205128205,90.47999999999999,1,10.615384615384615,312 +1618826146,4.448275862068965,84.1,1,16.344827586206897,290 +1618826151,11.928571428571429,32.48,1,29.785714285714285,112 +1618826156,15.433962264150944,30.74,1,37.301886792452834,106 +1618826161,15.874015748031496,36.83,1,25.62204724409449,127 +1618826166,11.201680672268907,69.02,1,17.60504201680672,238 +1618826171,9.205128205128204,90.47999999999999,1,14.615384615384615,312 +1618826176,5.436426116838488,84.39,1,16.309278350515463,291 +1618826181,10.807692307692307,60.31999999999999,1,24.423076923076923,208 +1618826186,5.90625,74.24,1,17.71875,256 +1618826191,15.090909090909092,31.9,1,29.272727272727273,110 +1618826196,8.949852507374631,98.30999999999999,1,13.849557522123893,339 +1618826201,15.62251655629139,43.79,1,26.867549668874172,151 diff --git a/morphemic-persistent-storage/docker-compose.yaml b/morphemic-persistent-storage/docker-compose.yaml index 4bb8e453bcd1e5ed494d21062ca2884dc0fdc100..e38593b623294f74483a4cd7413b37b6b62fe2bf 100644 --- a/morphemic-persistent-storage/docker-compose.yaml +++ b/morphemic-persistent-storage/docker-compose.yaml @@ -10,6 +10,8 @@ services: - "./database/.env" volumes: - "./database/data:/var/lib/influxdb" + ports: + - 8086:8086 publisher: image: jdtotow/publisher container_name: publisher diff --git a/morphemic-persistent-storage/example/influxdb_querier.py b/morphemic-persistent-storage/example/influxdb_querier.py index 079bc7f01cceeab639b260413ef9db79e0259338..5602d7cc7405b5120882178cec1d7df10313cfb6 100644 --- a/morphemic-persistent-storage/example/influxdb_querier.py +++ b/morphemic-persistent-storage/example/influxdb_querier.py @@ -8,7 +8,7 @@ url = "http://localhost:8086" username = "morphemic" password = "password" database = "morphemic" -application = 'application-1' +application = 'demo' params = '-sS' headers = {'Accept': 'application/csv', 'Content-type': 'application/vnd.flux','Authorization': 'Token '+username+':'+password} diff --git a/morphemic-persistent-storage/example/publisher.py b/morphemic-persistent-storage/example/publisher.py index d1a4ff6bfe68cbff89a050c3e48eed02a109ffb6..b062483573177b3f2689394da99ba59beb4a7a25 100644 --- a/morphemic-persistent-storage/example/publisher.py +++ b/morphemic-persistent-storage/example/publisher.py @@ -10,8 +10,7 @@ password = os.getenv("ACTIVEMQ_PASSWORD") or "111" host = os.getenv("ACTIVEMQ_HOST") or "localhost" port = os.getenv("ACTIVEMQ_PORT") or 61613 application_name = os.environ.get("APPLICATION_NAME","demo") -destination = sys.argv[1:2] or ["/queue/static-topic-1"] -destination = destination[0] +destination = "static-topic-1" connected = False conn = None diff --git a/morphemic-persistent-storage/example/subscriber.py b/morphemic-persistent-storage/example/subscriber.py index 8a5b0935056c58eb88fce65d73ab521e5daa98b6..d475a2c7b4d288ca7812219675b451b62c8bbdf9 100644 --- a/morphemic-persistent-storage/example/subscriber.py +++ b/morphemic-persistent-storage/example/subscriber.py @@ -9,8 +9,8 @@ user = os.getenv("ACTIVEMQ_USER") or "aaa" password = os.getenv("ACTIVEMQ_PASSWORD") or "111" host = os.getenv("ACTIVEMQ_HOST") or "localhost" port = os.getenv("ACTIVEMQ_PORT") or 61613 -destination = sys.argv[1:2] or ["/queue/persistent_storage"] -topic = 'tester' +destination = sys.argv[1:2] or ["/topic/static-topic-1"] +topic = 'static-topic-1' destination = destination[0] @@ -22,8 +22,8 @@ class Listener(object): def on_error(self, headers, message): print('received an error %s' % message) - def on_message(self, headers, message): - print(message) + def on_message(self, frame): + print(type(frame.body)) def sendSubscription(): conn = stomp.Connection(host_and_ports = [(host, port)]) @@ -43,7 +43,7 @@ def listen(): while True: time.sleep(2) -sendSubscription() +#sendSubscription() listen() #curl -X POST -d '{"application":"application_test","start":"10m"}' -H 'Content-type:application/json' http://localhost:8767/api/v1/make \ No newline at end of file