Lack of time field caused loss of Alarm History

The time field was name timestamp which caused influxdb to use the
write time for the time field. If multiple Alarm History messages
were written, Influxdb only kept the last because the times were
not unique.

Change-Id: I3808838bb8a26d7a6272ab41c3e586659a037f02
This commit is contained in:
Craig Bryant 2015-11-19 10:53:09 -07:00
parent 3964f2aae2
commit b20d019a20
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ class AlarmPersister(AbstractPersister):
ts = time_stamp / 1000.0
data = {"measurement": 'alarm_state_history',
"timestamp": datetime.fromtimestamp(ts, tz=pytz.utc).strftime(
"time": datetime.fromtimestamp(ts, tz=pytz.utc).strftime(
'%Y-%m-%dT%H:%M:%S.%fZ'),
"fields": {
"tenant_id": tenant_id.encode('utf8'),