Skip to main content
17-Peridot
May 25, 2018
Question

Alert history Stream Data

  • May 25, 2018
  • 1 reply
  • 2976 views
Hi,
I read somewhere, Stream is used in Thingworx time based data storage purposes. Generally timestamp is the Primary key for the stream.
Alert History Stream will have the alerts which are generated by all things across Thingworx.
If two alerts generated by two different things with same timestamp, both the alerts will store in the stream or what? How will be the behavior of stream ?

1 reply

1-Visitor
May 26, 2018

Alert history it's a total diferent thing than Stream and ValueStream storage.

What you stand here won't be a problem for Alert History, alerts are thrown at Property Level not at Thing Level, than por the same thing, same timestamp you already can have more than one alert.

17-Peridot
May 26, 2018
Alert history it's a total diferent thing than Stream and ValueStream storage.

If above mentioned statement is true then fine.

Thanks and Regards,
Sathishkumar C.
1-Visitor
May 26, 2018

No it isn't. According to ThingWorx help:

 

In PostgreSQL and H2, stream entries are keyed by the unique key entries of the timestamp and source.

 

For AlertHistoryStream the source corresponds to thing name, and timestamp resolution is 1ms. So if you have multiple alerts for the same thing firing at the same time, then you may lose some part of the history in random order. We actually encountered this in the past, and it's easily reproduceable. Try it! On my laptop the latest 8.2.5 on PostgreSQL loses about 2% of alert history when I'm doing something as simple as setting/resetting alerts on the same thing in the loop. The ironic bit here is that the faster your hardware, the more data you may lose.