Commit bf63e27e authored by Anna Warno's avatar Anna Warno
Browse files

prediction horizon units changed

parent 17e05436
......@@ -86,17 +86,17 @@ def main():
influxdb_conn = InfluxdbPredictionsSender(METHOD, APP_NAME)
logging.debug(
f"waiting {(msg['epoch_start'] - int(time.time()) * 1000 - prediction_cycle) // 1000} seconds"
f"waiting {(msg['epoch_start'] - int(time.time()) * 1000 - prediction_cycle * 1000) // 1000} seconds"
)
time.sleep(
max(0, (msg["epoch_start"] - int(time.time()) * 1000 - prediction_cycle))
max(0, (msg["epoch_start"] - int(time.time()) * 1000 - prediction_cycle * 1000))
// 1000
)
tl = Timeloop()
@tl.job(interval=timedelta(seconds=prediction_cycle // 1000))
@tl.job(interval=timedelta(seconds=prediction_cycle))
def metric_predict():
logging.debug("prediction")
dataset_preprocessor.prepare_csv()
......@@ -139,7 +139,7 @@ if __name__ == "__main__":
}
for m in msg["all_metrics"]
}
prediction_horizon = msg["prediction_horizon"]
prediction_horizon = msg["prediction_horizon"] * 1000
predicted_metrics = set(msg["metrics"])
prediction_cycle = msg["prediction_horizon"]
......
......@@ -49,7 +49,7 @@ if __name__ == "__main__":
}
for m in msg["all_metrics"]
}
prediction_horizon = msg["prediction_horizon"] // msg["publish_rate"]
prediction_horizon = (msg["prediction_horizon"] * 1000) // msg["publish_rate"]
predicted_metrics = set(metrics_info.keys())
logging.debug(f"Predicted metrics: {predicted_metrics}")
main(predicted_metrics, prediction_horizon)
......@@ -86,17 +86,17 @@ def main():
influxdb_conn = InfluxdbPredictionsSender(METHOD, APP_NAME)
logging.debug(
f"waiting {(msg['epoch_start'] - int(time.time()) * 1000 - prediction_cycle) // 1000} seconds"
f"waiting {(msg['epoch_start'] - int(time.time()) * 1000 - prediction_cycle * 1000) // 1000} seconds"
)
time.sleep(
max(0, (msg["epoch_start"] - int(time.time()) * 1000 - prediction_cycle))
max(0, (msg["epoch_start"] - int(time.time()) * 1000 - prediction_cycle * 1000))
// 1000
)
tl = Timeloop()
@tl.job(interval=timedelta(seconds=prediction_cycle // 1000))
@tl.job(interval=timedelta(seconds=prediction_cycle))
def metric_predict():
logging.debug("prediction")
dataset_preprocessor.prepare_csv()
......@@ -139,7 +139,7 @@ if __name__ == "__main__":
}
for m in msg["all_metrics"]
}
prediction_horizon = msg["prediction_horizon"]
prediction_horizon = msg["prediction_horizon"] * 1000
predicted_metrics = set(msg["metrics"])
prediction_cycle = msg["prediction_horizon"]
......
......@@ -49,7 +49,7 @@ if __name__ == "__main__":
}
for m in msg["all_metrics"]
}
prediction_horizon = msg["prediction_horizon"] // msg["publish_rate"]
prediction_horizon = (msg["prediction_horizon"] * 1000) // msg["publish_rate"]
predicted_metrics = set(metrics_info.keys())
logging.debug(f"Predicted metrics: {predicted_metrics}")
main(predicted_metrics, prediction_horizon)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment