I just tested InfluxDB with Grafana v4.1.1 and found that my stat widget did 
not behave as expected. I used the Grafana "current" option to get the last 
value of a query, but it always returned 0. I had to fix the query manually:

SELECT count(*) FROM "tag_hits" WHERE $timeFilter and time < now() GROUP BY 
time(10s,now())

i.e. I added 'and time < now()' for this to work. 

The problem seems to be caused by the now() interval shift, which starts (?) at 
the current time, always returning 0:


> SELECT count(*) FROM "tag_hits" WHERE time > now() - 2m and time < now() 
> GROUP BY time(10s,now())
name: tag_hits
time                    count_value
----                    -----------
1484584401492265398     9
1484584411492265398     10
1484584421492265398     9
1484584431492265398     9
1484584441492265398     9
1484584451492265398     10
1484584461492265398     8
1484584471492265398     9
1484584481492265398     10
1484584491492265398     9
1484584501492265398     9
1484584511492265398     10

> SELECT count(*) FROM "tag_hits" WHERE time > now() - 2m GROUP BY 
> time(10s,now())
name: tag_hits
time                    count_value
----                    -----------
1484584409590510584     10
1484584419590510584     9
1484584429590510584     9
1484584439590510584     10
1484584449590510584     9
1484584459590510584     8
1484584469590510584     9
1484584479590510584     10
1484584489590510584     9
1484584499590510584     9
1484584509590510584     10
1484584519590510584     9
1484584529590510584     0


Is this the desired behaviour?

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/b56eee14-2310-4c92-9363-6fb7700969c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to