Measure Query Execution Time

True, the influx CLI does not report any timings. But if you’re on a Unix-y system, you should be able to get an approximate execution time for a query via

$ time influx -execute 'SELECT foo FROM bar WHERE time > now() - 10s'

The last field in the HTTP logs (which are enabled by default) is the duration of the request in microseconds:

[httpd] ::1 - - [13/Mar/2017:08:47:41 -0700] "POST /query?chunked=true&db=_internal&epoch=s&q=SELECT+queryRespBytes+FROM+httpd+WHERE+time+%3E+now%28%29+-+30s HTTP/1.1" 200 151 "-" "InfluxDBShell/unknown" 643b51c5-0804-11e7-8004-000000000000 1244

In this case, 1244 means the request took (approximately) 1.244 milliseconds.

1 Like