Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating duration between a start and end event in InfluxDB

Tags:

influxdb

I have two write points for InfluxDB, one is the start and the other is the end. I just need to determine the duration between those two events, and make queries around it. InfluxDB has difference() aggregate method, but it doesn't work on the time meta field.

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

like image 437
Arbie Samong Avatar asked Jan 15 '15 08:01

Arbie Samong


1 Answers

As per "Can I perform mathematical operations against timestamps?"

No:

"Currently, it is not possible to execute mathematical operators against timestamp values in InfluxDB. Most time calculations must be carried out by the client receiving the query results."

and yes, maybe:

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

So it depends on the shape of your data.

like image 108
bartekbrak Avatar answered Jan 19 '23 00:01

bartekbrak