Merge "Distribute the AlarmStateTransitionEvents better"
This commit is contained in:
commit
198a5505d2
@ -517,7 +517,7 @@ where 'avg' is the arithmetic average. Note, threshold values are always in the
|
||||
|
||||
|
||||
#### Simple Example
|
||||
In this example the metric uniquely identified with the name=cpu.system_perc and dimension hostname=host.domain.com is compared to the threshold 95.
|
||||
In this example the metric uniquely identified with the name `cpu.system_perc` and dimension `hostname=host.domain.com` is compared to the threshold 95.
|
||||
|
||||
```
|
||||
cpu.system_perc{hostname=host.domain.com} > 95
|
||||
|
@ -51,6 +51,7 @@ public class AlarmService {
|
||||
private final Producer<String, String> producer;
|
||||
private final AlarmRepository repo;
|
||||
private final AlarmDefinitionRepository alarmDefRepo;
|
||||
private long messageCount = 0;
|
||||
|
||||
@Inject
|
||||
public AlarmService(MonApiConfiguration config, Producer<String, String> producer,
|
||||
@ -77,7 +78,7 @@ public class AlarmService {
|
||||
String event =
|
||||
Serialization.toJson(new AlarmDeletedEvent(tenantId, alarmId, metrics, alarm
|
||||
.getAlarmDefinition().getId(), subAlarmMetricDefs));
|
||||
producer.send(new KeyedMessage<>(config.eventsTopic, tenantId, event));
|
||||
producer.send(new KeyedMessage<>(config.eventsTopic, String.valueOf(messageCount++), event));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user