MCPcopy Create free account
hub / github.com/felixge/httpsnoop / CaptureMetrics

Function CaptureMetrics

capture_metrics.go:27–31  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

25// CaptureMetrics wraps the given hnd, executes it with the given w and r, and
26// returns the metrics it captured from it.
27func 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

Callers 1

benchmarkFunction · 0.85

Calls 1

CaptureMetricsFnFunction · 0.85

Tested by 1

benchmarkFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…