Calculation of the duration between the start and end events in InfluxDB

I have two recording points for InfluxDB, one of which is the beginning and the other is the end. I just need to determine the duration between these two events and make requests around it. InfluxDB has an aggregate () method, but it does not work in the time meta field.

Is supplying a custom timestamp value the only way to do this?

+5
source share
2 answers

If you write only the two entries mentioned, you can follow these steps:

  • Limit the result to two (for example: select * from timeseries limit 2)
  • Retrieve time from a result set
  • Take the difference between time
0
source

Like " Can I do mathematical operations against timestamps? "

Not:

"Currently, it is not possible to perform mathematical operators regarding timestamp values ​​in InfluxDB. Most time calculations should be performed by the client receiving the query results."

and yes, maybe:

The ELAPSED () function returns the difference between subsequent timestamps in a single field.

So it depends on the form of your data.

0
source

Source: https://habr.com/ru/post/1211143/


All Articles