diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-08-02 01:18:26 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-08-02 01:18:26 +0500 |
| commit | df9cc31a0a403daf2694048dbb3593e14ba72b6a (patch) | |
| tree | 2aee6a737e6556b018ac0d54d03690dc22f5569b /weed/server/volume_server_handlers.go | |
| parent | 0a5d3c3cf65516737f07ca6802bd6a2d2b327446 (diff) | |
| download | seaweedfs-df9cc31a0a403daf2694048dbb3593e14ba72b6a.tar.xz seaweedfs-df9cc31a0a403daf2694048dbb3593e14ba72b6a.zip | |
refactor
Diffstat (limited to 'weed/server/volume_server_handlers.go')
| -rw-r--r-- | weed/server/volume_server_handlers.go | 6 |
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 { |
