I am debugging some emerging issues with Hubigraphs. When I used to do a call to statesSince, it would return a set of state events upto ~1024. Now, I get ~32. I have checked the device data and it appears to be there, the function is just not returning the amount of data I expect.
Yes, the number of points in device state history has been trimmed. The call is unchanged, but the number of underlying data points retained is smaller.
I'll add a state history size, similar to event history size, to the next beta. Default is going to stand where it is for performance reasons, but user will be able to override it for a given device.
Thanks Vic. I'm confused, Mike & Bruce have long said the hub has way more power/storage than it actually uses, yet the events were trimmed for performance. I love having longer event histories, too bad there wasn't a switch or selector where we could choose small, medium or large.
Any easy way to export the device history/logs to local PC?
Starting with 2.2.3.138 - currently in beta - there's a per device setting, just as rob9 pointed out. Default setting is 30, which is pretty small, and is enough if an app is looking at the last few values. If longer history is needed, such as with graphs, max value is 2000.
I've been looking at some databases, and there were instances with almost a million device state entries. Any time device state changes, H2 has to modify indexes. As long as it fits the entire thing in memory cache, it's pretty fast about it. As table grows, there is no threshold where it gets slow all of a sudden, it's a gradual change. Per-device history size setting is there so that a user can keep important history if he/she wishes so.
Compared to 2.2.3.118's default of 30, I don't think you will notice an impact at all. Compared to the previous default of 2000, it would speed things up considerably.
Thanks for putting this in; I have to put in my agreement that the change has been great overall for the hub. Graphs that might take minutes to load, now do so in seconds....
So. Although this state information is available for apps, I'm not seeing how I can find it through the native interface.
I would think I should be able to click on something under the "Device" page to bring up a device's past history (without having to write an app--as I'd think most people would have a general desire to check back on a device). Having the list of all device states/events under "System Events" would also be useful.