CaptureMetrics wraps the given hnd, executes it with the given w and r, and returns the metrics it captured from it.
(hnd http.Handler, w http.ResponseWriter, r *http.Request)
| 25 | // CaptureMetrics wraps the given hnd, executes it with the given w and r, and |
| 26 | // returns the metrics it captured from it. |
| 27 | func CaptureMetrics(hnd http.Handler, w http.ResponseWriter, r *http.Request) Metrics { |
| 28 | return CaptureMetricsFn(w, func(ww http.ResponseWriter) { |
| 29 | hnd.ServeHTTP(ww, r) |
| 30 | }) |
| 31 | } |
| 32 | |
| 33 | // CaptureMetricsFn wraps w and calls fn with the wrapped w and returns the |
| 34 | // resulting metrics. This is very similar to CaptureMetrics (which is just |
searching dependent graphs…