@@ -14,6 +14,7 @@ from src.dataset_maker import CSVData
frompytzimporttimezone
importpytz
fromdatetimeimportdatetime
importrandom
METHOD=os.environ.get("METHOD","nbeats")
START_TOPIC=f"start_forecasting.{METHOD}"
...
...
@@ -146,6 +147,7 @@ def main():
print(
f"metric: {metric}, Time difference between current and last horizon: {prediction_msgs[-1][metric]['predictionTime']-current_time} seconds. TIME: {datetime.now(pytz.timezone(TZ)).strftime('%d/%m/%Y %H:%M:%S')}"
f"Sending predictions for {metric} metric TIME: {datetime.now(pytz.timezone(TZ)).strftime('%d/%m/%Y %H:%M:%S')}"
)
start_conn.send_to_topic(dest,message[metric])
influxdb_conn.send_to_influxdb(metric,message)
dest=f"{PRED_TOPIC_PREF}.{metric}"
print(
f'{int(prediction_msgs[metric]["predictionTime"])-int(prediction_msgs[metric]["timestamp"])} difference between timestamp and predicted in secnds'
)
logging.info(
f'{int(prediction_msgs[metric]["predictionTime"])-int(time.time())} difference between current time and predicted in secnds TIME: {datetime.now(pytz.timezone(TZ)).strftime("%d/%m/%Y %H:%M:%S")}'
f"metric: {metric}, Time difference between current and last horizon: {prediction_msgs[-1][metric]['predictionTime']-current_time} seconds. TIME: {datetime.now(pytz.timezone(TZ)).strftime('%d/%m/%Y %H:%M:%S')}"
)
print(
f"metric: {metric}, Time difference between current and last horizon: {prediction_msgs[-1][metric]['predictionTime']-current_time} seconds. TIME: {datetime.now(pytz.timezone(TZ)).strftime('%d/%m/%Y %H:%M:%S')}"
f"Sending predictions for {metric} metric TIME: {datetime.now(pytz.timezone(TZ)).strftime('%d/%m/%Y %H:%M:%S')}"
)
start_conn.send_to_topic(dest,message[metric])
influxdb_conn.send_to_influxdb(metric,message)
dest=f"{PRED_TOPIC_PREF}.{metric}"
print(
f'{int(prediction_msgs[metric]["predictionTime"])-int(prediction_msgs[metric]["timestamp"])} difference between timestamp and predicted in secnds'
)
logging.info(
f'{int(prediction_msgs[metric]["predictionTime"])-int(time.time())} difference between current time and predicted in secnds TIME: {datetime.now(pytz.timezone(TZ)).strftime("%d/%m/%Y %H:%M:%S")}'
f"metric: {metric}, Time difference between current and last horizon: {prediction_msgs[-1][metric]['predictionTime']-current_time} seconds. TIME: {datetime.now(pytz.timezone(TZ)).strftime('%d/%m/%Y %H:%M:%S')}"
)
print(
f"metric: {metric}, Time difference between current and last horizon: {prediction_msgs[-1][metric]['predictionTime']-current_time} seconds. TIME: {datetime.now(pytz.timezone(TZ)).strftime('%d/%m/%Y %H:%M:%S')}"