cloudfoundry/cloud_controller_ng — pull request #170 by sykesm (2014-02-23 23:38:41+00:00)
Title: Provide on outstanding request information in the cloud controller's /varz

Debugging 502 timeouts from the router to the cloud controller has been very difficult without the ability to quickly determine which requests have been executing for a long time. Adding a hash to the cc's /varz that lists requests requests that are currently dispatched should help that somewhat.

This PR provides a mechanism to get the information about outstanding requests that includes vcap request id, the cc resource, the request method, and a time stamp representing when the request processing started. The information can help correlate information from the routers with information in the CCs.

```json
{
"vcap_sinatra": {
"requests": { "outstanding": 3, "completed": 441 },
"outstanding_requests": {
"f07b0f9b-68db-456a-8a11-0e419e8e8734": {
"request_method": "GET",
"request_uri": "/v2/apps/026d94dd-0237-485b-87cf-20b9f747c34f/stats",
"thread_id": 45684220,
"start_time": 1393191786.0413954
},
"7481088f-c710-4aa0-a597-d3cd2fe92ed0": {
"request_method": "GET",
"request_uri": "/v2/apps/941cbac8-d5dc-47f5-9d6d-275e212b9232/stats",
"thread_id": 33635860,
"start_time": 1393191786.0595853
},
"a81ade89-5fb9-46c9-b630-3989aef9b3ef": {
"request_method": "GET",
"request_uri": "/v2/apps/b398bdd1-c3be-444d-99b1-56d318a1e1f3/stats",
"thread_id": 45684160,
"start_time": 1393191786.1119301
},
},
"...": "..."
}
}
```
If there's a better place to put this that would not be disabled in production environments that that could build on credentials from the discovery response, please provide some direction.