prometheus/web
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
..
api Adds execution timer stats to the range query 2017-11-16 16:05:10 +01:00
ui Fix display of raw target labels (again) (#3437) 2017-11-08 15:30:19 +01:00
federate_test.go Merge branch 'master' into dev-2.0 2017-09-04 14:09:21 +02:00
federate.go Re-add contexts to storage.Storage.Querier() (#3230) 2017-10-04 21:04:15 +02:00
web_test.go Merge pull request #3286 from prometheus/dev-2.0 2017-10-12 16:19:10 +02:00
web.go Refactor main.go with oklog/pkg/group actors pattern 2017-11-11 12:33:15 +00:00