Skip to content

Commit

Permalink
Merge upstream changes (#10)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
atsag authored Sep 19, 2024
1 parent 81870e5 commit 491d01f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exponential-smoothing-predictor/src/runtime/Predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 491d01f

Please sign in to comment.