Commit eba1dd0d authored by I Patini's avatar I Patini
Browse files

EMS: Control Service: Changed TopicBeacon to *not* send prediction or...

EMS: Control Service: Changed TopicBeacon to *not* send prediction or slo-violation-detector events, if they are going to be empty
parent b22aab69
Pipeline #19861 passed with stages
in 37 minutes and 2 seconds
......@@ -167,6 +167,12 @@ public class TopicBeacon implements InitializingBean {
}).collect(Collectors.toList());
log.debug("Topic Beacon: Transmitting Prediction info: Metric Contexts in event format: {}", payload);
// Skip event sending if payload is empty
if (payload.size()==0) {
log.debug("Topic Beacon: Transmitting Prediction info: Event is empty. Not sending anything");
return;
}
String eventPayload = gson.toJson(payload);
log.debug("Topic Beacon: Transmitting Prediction info: event={}, topics={}", eventPayload, beaconPredictionTopics);
......@@ -189,6 +195,12 @@ public class TopicBeacon implements InitializingBean {
return;
log.debug("Topic Beacon: transmitSloViolatorInfo: SLO metric decompositions: {}", sloMetricDecompositions);
// Skip event sending if payload is empty
if (!(sloMetricDecompositions instanceof Map) || ((Map) sloMetricDecompositions).size() == 0) {
log.debug("Topic Beacon: transmitSloViolatorInfo: Event is empty. Not sending anything");
return;
}
String eventPayload = gson.toJson(sloMetricDecompositions);
log.debug("Topic Beacon: Transmitting SLO Violator info: event={}, topics={}", eventPayload, beaconSloViolationDetectorTopics);
......
Supports Markdown
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