GroveStreams
JChristensen private msg quote post Address this user
I have a regular data stream which represents the number of seconds a device is running. Data is posted every 10 minutes. I want to create a line chart which shows a daily total number of hours, i.e. one point per day.

I've only accumulated three days' data so far but I've set the chart up for a month (30 days).

On the chart settings data tab, I choose cycle=days and statistic=sum. Everything looks fine, I see total number of seconds. When I add "value/3600" to the "apply expression" property to convert to hours, then I see non-zero values for the earlier days that have no data.

I must be missing something but haven't found it yet. For the three days that have data, the calculated value is correct.

First chart below shows the results with nothing in "apply expression". No points are plotted for days without data, as I would expect. The second chart shows the non-zero values with an expression of "value/3600". Any sort of calculation seems to cause a similar effect, even "value*1".





Post 1 IP   flag post
MikeMills private msg quote post Address this user
Good catch. This is a problem on our servers when we process the eval expression. It's not handling NULLs properly and using if(isNull(value),..,..) as your expression won't fix it.

We'll put a patch together. Just dwelling on the solution. Initially, I'm thinking, that we'll just return null if "value" is null.
Post 2 IP   flag post
JChristensen private msg quote post Address this user
Thanks, Mike. Not an emergency for me so as you can get to it is fine. Glad to know I wasn't missing something! I also noticed that the value (0.11 in my example chart) changes from time to time, maybe as data is added. I also think I saw it read zero once; for a minute there I thought it had fixed itself but no such luck. Returning NULL when the value is NULL sounds fine...
Post 3 IP   flag post
MikeMills private msg quote post Address this user
I'll post on this thread when the patch is applied.
Post 4 IP   flag post
MikeMills private msg quote post Address this user
Patch applied.
Post 5 IP   flag post
JChristensen private msg quote post Address this user
Chart looks fine now. Thanks a bunch, Mike!

Post 6 IP   flag post
2756 6 6
Log in or sign up to compose a reply.
destitute