From 491d01fd912e3bcb8285c027a2997666663ee4f1 Mon Sep 17 00:00:00 2001 From: atsag Date: Thu, 19 Sep 2024 17:02:12 +0300 Subject: [PATCH] Merge upstream changes (#10) * Miscellaneous improvements Added required dependencies in the setup script Improved logging during dataset creation Added README.md file Change-Id: I67e98938f3660656d2ced916f258dfe5d475ecd3 * Readme file location correction Corrected the location of the README.md file Change-Id: I89b86b7471123d653592cd98f513ff25181d2520 * Environment variable correction Added default value for an environmental variable Change-Id: I81ca8f427c78aaec62d3eef9bad47d685e2a84ba * Small configuration file improvements * Corrected the publishing of forecasts for a particular application * Retrieve the appropriate publisher to publish predictions, using the application name --- exponential-smoothing-predictor/src/runtime/Predictor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exponential-smoothing-predictor/src/runtime/Predictor.py b/exponential-smoothing-predictor/src/runtime/Predictor.py index 14c59a3..c7e5c66 100755 --- a/exponential-smoothing-predictor/src/runtime/Predictor.py +++ b/exponential-smoothing-predictor/src/runtime/Predictor.py @@ -192,7 +192,7 @@ def update_prediction_time(epoch_start,prediction_horizon,maximum_time_for_predi def calculate_and_publish_predictions(application_state,maximum_time_required_for_prediction): start_forecasting = application_state.start_forecasting - + application_name = application_state.application_name while start_forecasting: print_with_time("Using " + EsPredictorState.configuration_file_location + " for configuration details...") application_state.next_prediction_time = update_prediction_time(application_state.epoch_start, application_state.prediction_horizon,maximum_time_required_for_prediction) @@ -254,8 +254,8 @@ def calculate_and_publish_predictions(application_state,maximum_time_required_fo for publisher in EsPredictorState.broker_publishers: #if publisher.address=="eu.nebulouscloud.monitoring.preliminary_predicted.exponentialsmoothing"+attribute: - if publisher.key=="publisher_"+attribute: - publisher.send(prediction_message_body) + if publisher.key=="publisher_"+application_name+"-"+attribute: + publisher.send(prediction_message_body,application_name) #State.connection.send_to_topic('intermediate_prediction.%s.%s' % (id, attribute), prediction_message_body) @@ -303,7 +303,7 @@ def on_message(self, key, address, body, context, **kwargs): address = address.replace("topic://"+EsPredictorState.GENERAL_TOPIC_PREFIX,"") if (address).startswith(EsPredictorState.MONITORING_DATA_PREFIX): address = address.replace(EsPredictorState.MONITORING_DATA_PREFIX, "", 1) - + logging.info("New monitoring data arrived at topic "+address) if address == 'metric_list': application_name = body["name"]