aboutsummaryrefslogtreecommitdiff
path: root/weed/server/volume_server_handlers.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-08-02 01:18:26 +0500
committerKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-08-02 01:18:26 +0500
commitdf9cc31a0a403daf2694048dbb3593e14ba72b6a (patch)
tree2aee6a737e6556b018ac0d54d03690dc22f5569b /weed/server/volume_server_handlers.go
parent0a5d3c3cf65516737f07ca6802bd6a2d2b327446 (diff)
downloadseaweedfs-df9cc31a0a403daf2694048dbb3593e14ba72b6a.tar.xz
seaweedfs-df9cc31a0a403daf2694048dbb3593e14ba72b6a.zip
refactor
Diffstat (limited to 'weed/server/volume_server_handlers.go')
-rw-r--r--weed/server/volume_server_handlers.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.go
index e95ecc8da..fd043ad51 100644
--- a/weed/server/volume_server_handlers.go
+++ b/weed/server/volume_server_handlers.go
@@ -36,6 +36,11 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Credentials", "true")
}
+ stats.VolumeServerRequestCounter.WithLabelValues(r.Method).Inc()
+ start := time.Now()
+ defer func() {
+ stats.VolumeServerRequestHistogram.WithLabelValues(r.Method).Observe(time.Since(start).Seconds())
+ }()
switch r.Method {
case "GET", "HEAD":
stats.ReadRequest()
@@ -56,7 +61,6 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque
stats.DeleteRequest()
vs.guard.WhiteList(vs.DeleteHandler)(w, r)
case "PUT", "POST":
-
contentLength := getContentLength(r)
// exclude the replication from the concurrentUploadLimitMB
if r.URL.Query().Get("type") != "replicate" && vs.concurrentUploadLimit != 0 {