diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.go index fd043ad51..92f7cca1d 100644 --- a/weed/server/volume_server_handlers.go +++ b/weed/server/volume_server_handlers.go @@ -38,9 +38,9 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque } stats.VolumeServerRequestCounter.WithLabelValues(r.Method).Inc() start := time.Now() - defer func() { + defer func(start time.Time) { stats.VolumeServerRequestHistogram.WithLabelValues(r.Method).Observe(time.Since(start).Seconds()) - }() + }(start) switch r.Method { case "GET", "HEAD": stats.ReadRequest()