Very fast updating values

Started by LukaQ, January 11, 2017, 02:54:18 AM

LukaQ

Hello,

Let say, you have something, that is able to update very fast (probably not that fast if wireless), and you are not looking at slow changing value, like temperature could be.
What I found is, that is you update value several times a second, it gets harder and harder to get into that node and to the graph (because of updating), gets worse the faster it gets.
Is that something anyone found to be also his "problem"?

Let's say you have have the temperature measurement, which data is flowing in at not constant rate, but the higher the change rate, the shorter time between samples would be. And when slow changing rate of temperature, updates would become far more apart.
That way you would have detailed temperature drop/rise, but not swamp DB with excessive amount of data, when temperature would be almost constant

Luka

Felix

Quote from: LukaQ on January 11, 2017, 02:54:18 AM
What I found is, that is you update value several times a second, it gets harder and harder to get into that node and to the graph (because of updating), gets worse the faster it gets.
Is that something anyone found to be also his "problem"?


What does "harder and harder" translate to exactly?
Is the webpage (GUI) loading slower and slower as you ... log faster and faster or what is the relation?

The logUtil.js logger has a resolution of 1 second as it is configured. That means that a value will overwrite if written more often than 1 second.

LukaQ

Hello,

It means, that when data comes in, in that moment I can't enter that variable of that node, that was updated. It's like your window of time, when you can click and enter to see graph is short, too short to catch it with mouse click. Picture this: you are logging temperature once every 30s. In that 30s, let's say you have 29.5s where you have no problem clicking temperature, to see graph. Other 0.5s is just after new value of that temperature has come in and you can't click to see the graph in that time. (0.5s is far too big, it's much less than that).

Now, to what I've seen, your new value comes in every 1s. That leaves you with 0.5s to click, before new data get in and you get "lock out". I understand this is extreme case and unlikely to ever be an issue, but.. I had some data come in every 0.1s. And I had to click over 10x with mouse on temperature, to get to graph page. Now I don't know, who is slow here (apart from my mouse clicks that is),  gateway's ability to process all that or is it because of baud rate or what? Did you try that at any point?

QuoteIs the webpage (GUI) loading slower and slower as you ... log faster and faster or what is the relation?
Yes, gui slower, but in sense of not update values fast, but letting me click on anything (and do what is supposed to happen)

Felix

Really hard to say since I can't see what's going on. Your Pi or SD card could be slow, but I doubt that's the case. Your connection could be slow.
The baud is not a problem since even at 19200 that's way more than you need at your message frequency.
What i understand is that in between your click on the metric (to get to the graph) a new data is received and you no longer are seeing the "latest" data in the graph. In that case click on one of the buttons to try and get the latest data (1day, 8hour, 1hour). Hopefully that should give you the latest and then any new data will shift the graph as you probably expect.
Other than that, if you find a bug or can document why the app would be slow in your case let me know.
But usually the socket is very fast, much more so than a page refresh or regular (x)HTTP request.

LukaQ

#4
Yea I don't think this will be every a problem, don't even think someone would use few hundred nodes. But that would be something too great to see.
Pi isn't breaking a sweat, class10 SD card is far too fast. I think that 5kB/s of data was all that was need to show all metrics change, so even any internet speed you have will be enough. And it's crazy to think you would need to log something faster than 1s. So really, my test was kinda overkill.

Everything else works as intended.

Did you ever think about having graphs on dashboard, like pinned graphs of some metric?
Or boxes instead of lines for nodes (if you would have many nodes, there would be long list of nodes)?
How about being able to see some metrics outside dashboard (without login)?
Or is there already a way to put some metric to lets say any website, on personal webpage?

Not related, but: why is humidity averaged or so it looks like, smooth, but temperature is not and has steps? is this setting, coz I don't see it anywhere?

Felix

To your questions the answers are:

- not implemented but could be in a future version (dashboard customization beyond what you see now)
- yes it's possible (boxes instead of lines in graphs)
- it's a setting (smooth graphs)
- no (see stuff without login) -- well in fact you could disable authentication but i doubt you'd want that
- see metrics on another site? haven't really seen a need for this

The metrics define how a graph is displayed, whether it's smoothed or boxes/lines/dots, it's fully customizable, see metrics.js for details.

LukaQ

what I have is, webpage, where I put all the important data I would like to know, all in one page:

Something like:
- how many page visits I get and to which pages
- what is the temperature in room where server is
- etc

Something like temperature would be harmful if exposed with no login, to be able to see this value just by grabbing if from before login dashboard or something, it could always be after, if it would be implemented like this. For example, something like OEM has with their emoncms: you need API key, to get to the data..

QuoteThe metrics define how a graph is displayed, whether it's smoothed or boxes/lines/dots, it's fully customizable, see metrics.js for details
Thanks, man there is a lot of stuff in there  :D

Do you have any forum thread or on website for new features, need to haves, requests,...?

Felix

Yes an API key would do it. I didn't put the time into something like that since I have no need for it.

Quote from: LukaQ on January 11, 2017, 11:21:29 PM
Do you have any forum thread or on website for new features, need to haves, requests,...?

This forum is just that. But keep in mind I built this software to suit my personal needs and I released it to the public in case someone finds it useful.
I added features that I thought would be useful along the way and I want to add more.
You're welcome to suggest new features and fix bugs but it comes with no guarantees, like any open software.