From ef9fc62cdc3cc5abc33d6018fe1324890bb48145 Mon Sep 17 00:00:00 2001 From: Mitar Date: Thu, 14 Apr 2022 12:07:28 +0200 Subject: [PATCH] Allow specifying initial metrics. --- capture_metrics.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/capture_metrics.go b/capture_metrics.go index d9d3427..b77cc7c 100644 --- a/capture_metrics.go +++ b/capture_metrics.go @@ -41,7 +41,8 @@ func CaptureMetricsFn(w http.ResponseWriter, fn func(http.ResponseWriter)) Metri } // CaptureMetrics wraps w and calls fn with the wrapped w and updates -// Metrics m with the resulting metrics. +// Metrics m with the resulting metrics. This is similar to CaptureMetricsFn, +// but allows one to customize starting Metrics object. func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWriter)) { var ( start = time.Now()