mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-22 21:03:32 +08:00
volume server: adds basic metrics
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user