prometheus/promql
David Kaltschmidt c93e54d240 Adds execution timer stats to the range query
API consumers should be able to get insight into the query run times.
The UI currently measures total roundtrip times. This PR allows for more
fine grained metrics to be exposed.

* adds new timer for total execution time (queue + eval)

* expose new timer, queue timer, and eval timer in stats field of the
 range query response:
```json
{
  "status": "success",
  "data": {
    "resultType": "matrix",
    "result": [],
    "stats": {
      "execQueueTimeNs": 4683,
      "execTotalTimeNs": 2086587,
      "totalEvalTimeNs": 2077851
    }
  }
}
```

* stats field is optional, only set when query parameter `stats` is not
empty

Try it via
```sh
curl 'http://localhost:9090/api/v1/query_range?query=up&start=1486480279&end=1486483879&step=14000&stats=true'
```

Review feedback

* moved query stats json generation to query_stats.go
* use seconds for all query timers
* expose all timers available
* Changed ExecTotalTime string representation from Exec queue total time to Exec total time
2017-11-16 16:05:10 +01:00
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
testdata Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
ast.go Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
bench_test.go Add _test.go suffix to promql/{bench.go, test.go} to prevent importing the testing package in a normal binary. 2017-07-07 15:52:44 +01:00
engine.go Adds execution timer stats to the range query 2017-11-16 16:05:10 +01:00
engine_test.go Re-add contexts to storage.Storage.Querier() (#3230) 2017-10-04 21:04:15 +02:00
functions.go Add back continue. 2017-10-09 19:44:03 +01:00
functions_test.go Merge branch 'master' into mergemaster 2017-08-10 17:04:25 +02:00
fuzz.go textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
lex.go Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
lex_test.go Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
parse.go Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
parse_test.go Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
printer.go Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
printer_test.go Remove keep_common modifier. 2017-10-05 13:27:48 +01:00
promql_test.go Fix most golint warnings. 2015-08-26 12:44:46 +02:00
quantile.go Merge branch 'master' into dev-2.0 2017-04-27 10:19:55 +02:00
test.go Migrate "golang.org/x/net/context" -> "context" (#3333) 2017-10-24 21:21:42 -07:00
test_test.go Add _test.go suffix to promql/{bench.go, test.go} to prevent importing the testing package in a normal binary. 2017-07-07 15:52:44 +01:00
value.go Add license to files. 2017-04-19 13:46:22 +01:00