AlarmStateTransitionedEvent timestamp now in ms
This will ensure a unique timestamp. Influx will only keep one entry with the same timestamp Change-Id: Ibf1001fea9328a6541381d344221b86e39996e1d
This commit is contained in:
parent
e3ac4b0857
commit
6bdef9f492
@ -238,7 +238,7 @@ public class AlarmThresholdingBolt extends BaseRichBolt {
|
||||
}
|
||||
|
||||
protected long getTimestamp() {
|
||||
return System.currentTimeMillis() / 1000;
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
void handleAlarmDeleted(String alarmId) {
|
||||
|
@ -125,7 +125,7 @@ public class AlarmThresholdingBoltTest {
|
||||
+ "\"stateChangeReason\":\"Thresholds were exceeded for the sub-alarms: "
|
||||
+ subAlarm.getExpression().getExpression() + " with the values: []\"," + "\"severity\":\"LOW\","
|
||||
+ "\"subAlarms\":[" + buildSubAlarmJson(alarm.getSubAlarms()) + "],"
|
||||
+ "\"timestamp\":1395587091}}";
|
||||
+ "\"timestamp\":1395587091003}}";
|
||||
|
||||
verify(alarmEventForwarder, times(1)).send(alarmJson);
|
||||
verify(alarmDAO, times(1)).updateState(alarmId, AlarmState.ALARM);
|
||||
@ -150,7 +150,7 @@ public class AlarmThresholdingBoltTest {
|
||||
+ subAlarms.get(2).getExpression().getExpression() + " with the values: []"
|
||||
+ "\",\"severity\":\"LOW\","
|
||||
+ "\"subAlarms\":[" + buildSubAlarmJson(alarm.getSubAlarms()) + "],"
|
||||
+ "\"timestamp\":1395587091}}";
|
||||
+ "\"timestamp\":1395587091003}}";
|
||||
verify(alarmEventForwarder, times(1)).send(okJson);
|
||||
verify(alarmDAO, times(1)).updateState(alarmId, AlarmState.OK);
|
||||
}
|
||||
@ -327,7 +327,7 @@ public class AlarmThresholdingBoltTest {
|
||||
@Override
|
||||
protected long getTimestamp() {
|
||||
// Have to keep the time stamp constant so JSON comparison works
|
||||
return 1395587091;
|
||||
return 1395587091003l;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user