Merge "Distribute the AlarmStateTransitionEvents better"

This commit is contained in:
Jenkins 2014-12-12 18:22:44 +00:00 committed by Gerrit Code Review
commit 198a5505d2
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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));
}
/**