mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-15 20:06:19 +08:00
adding lots of different stats
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"code.google.com/p/weed-fs/go/util"
|
||||
"mime"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -259,3 +260,16 @@ func (vs *VolumeServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||
m["size"] = uint32(count)
|
||||
writeJsonQuiet(w, r, m)
|
||||
}
|
||||
|
||||
func (vs *VolumeServer) statsDiskHandler(w http.ResponseWriter, r *http.Request) {
|
||||
m := make(map[string]interface{})
|
||||
m["Version"] = util.VERSION
|
||||
ds := make([]*stats.DiskStatus, 0)
|
||||
for _, loc := range vs.store.Locations {
|
||||
if dir, e := filepath.Abs(loc.Directory); e == nil {
|
||||
ds = append(ds, stats.NewDiskStatus(dir))
|
||||
}
|
||||
}
|
||||
m["DiskStatues"] = ds
|
||||
writeJsonQuiet(w, r, m)
|
||||
}
|
||||
|
Reference in New Issue
Block a user