Skip to content

Commit

Permalink
Intermediate metric consumer fix (#8)
Browse files Browse the repository at this point in the history
* Change in how metrics consumer is created

* Change in how metrics consumer is created
  • Loading branch information
jmarchel7bulls authored Sep 25, 2024
1 parent b7b43fe commit b9f7e4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion prediction-orchestrator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
<version>4.3</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void onMessage(String key, String address, Map body, Message message, Con
context.registerConsumer(new RealtimeApplicationMetricConsumer(app_id));
break;
case "intermediate":
context.registerConsumer(new IntermediateMetricsConsumer(predictionRegistry));
break;
default:
log.warn("Unknown mode: {}", mode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import eu.nebulouscloud.exn.core.Consumer;
import eu.nebulouscloud.exn.settings.StaticExnConfig;
import eu.nebulouscloud.predictionorchestrator.Orchestrator;
import eu.nebulouscloud.predictionorchestrator.PredictionRegistry;
import eu.nebulouscloud.predictionorchestrator.Properties;
import eu.nebulouscloud.predictionorchestrator.communication.consumers.IntermediateMetricsConsumer;
import eu.nebulouscloud.predictionorchestrator.communication.consumers.MetricsListConsumer;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -48,6 +50,9 @@ public class BrokerConnector {
@Autowired
private BrokerConnectorHandler brokerConnectorHandler;

@Autowired
private PredictionRegistry predictionRegistry;

@PostConstruct
public void init() {
startConnector();
Expand All @@ -61,7 +66,9 @@ private void startConnector() {
brokerConnectorHandler,
List.of(), // List of publishers
List.of(new Consumer("ui_app_messages", app_creation_channel,
applicationCreationHandler, true, true), new MetricsListConsumer(orchestrator, properties)),
applicationCreationHandler, true, true),
new MetricsListConsumer(orchestrator, properties),
new IntermediateMetricsConsumer(predictionRegistry)),
true, // enableState
true, // enableHealth
new StaticExnConfig(host, port, username, password, retryAttempts) // Configuration
Expand Down

0 comments on commit b9f7e4c

Please sign in to comment.