mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-16 11:08:39 +02:00
volume: fix metrics for volume request time
This commit is contained in:
1 parent
7fcfaf7bc9
commit
e259052a70
1 file changed
+2
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user