aboutsummaryrefslogtreecommitdiff
path: root/weed/server/volume_server_handlers_write.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/server/volume_server_handlers_write.go')
-rw-r--r--weed/server/volume_server_handlers_write.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go
index 7c0e08554..b53defd26 100644
--- a/weed/server/volume_server_handlers_write.go
+++ b/weed/server/volume_server_handlers_write.go
@@ -15,6 +15,11 @@ import (
)
func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
+
+ volumeServerRequestCounter.WithLabelValues("post").Inc()
+ start := time.Now()
+ defer func() { volumeServerHistogram.WithLabelValues("post").Observe(time.Since(start).Seconds()) }()
+
if e := r.ParseForm(); e != nil {
glog.V(0).Infoln("form parse error:", e)
writeJsonError(w, r, http.StatusBadRequest, e)
@@ -60,6 +65,11 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
}
func (vs *VolumeServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
+
+ volumeServerRequestCounter.WithLabelValues("delete").Inc()
+ start := time.Now()
+ defer func() { volumeServerHistogram.WithLabelValues("delete").Observe(time.Since(start).Seconds()) }()
+
n := new(needle.Needle)
vid, fid, _, _, _ := parseURLPath(r.URL.Path)
volumeId, _ := needle.NewVolumeId(vid)