I want to capture the total time for a particular test and the start time. Test id work as a unique value for a range.
Calculate the total spent time (last time - first time) with the help of the test ID
(like this Manipulate timestamps with Flux | InfluxDB OSS 1.8 Documentation)
Display the start time (first time)
help me or guide me on how to extract the above details.
Datasource: InfluxDB 1.8 and using Influxql.
- I believe your influxql query might look something like this:
SELECT ELAPSED("first-minus_last") FROM SELECT first("water_level"), last("water_level") FROM "h2o_feet" WHERE "location" = 'santa_monica' AND time >= '2015-08-18T00:00:00Z' AND time <= '2015-08-18T00:12:00Z'
- SELECT first(“water_level”) FROM “h2o_feet” WHERE “location” = ‘santa_monica’ AND time >= ‘2015-08-18T00:00:00Z’ AND time <= ‘2015-08-18T00:12:00Z’
InfluxDB doesn’t keep global variables or values. In other words there isn’t a way to get the true first value without query for all of your data.
Out of curiosity, why are you using InfluxDB 1.x instead of 2.x? And what are you doing with InfluxDB?