Help using now() with precision 'ms'

time
influxql
influxdb
#1

I feel like I’m probably doing something silly, but I can’t get a relative time query that uses now() to select the proper data. In my scenario I have data for each day of the the past month and half, or so. I want to query only for data that happened in the last 2 weeks. I’m trying a query like this:

SELECT state FROM testmetrics where file='request-basic.js' AND time > now() - 2w

But it’s not returning anything. I suspect that it has something to do with how I’m writing my points with ms precision as specified here in the library that I’m using.

Precision at which the points are written, defaults to milliseconds ‘ms’. Influx recommends that you use the coarsest precision possible in order to maximize efficiency.

If it’s the case that I’m saving the timestamps in ms (even though influx always returns ns on queries) is it possible time is in ms when > now() - 2w is n in my query resulting in no matches?

#3

Lol. I’m so mad at myself. There is no data for that range. I had botched a quick check for what the latest timestamp date was.

closed #4
opened #5