adding lots of different stats

This commit is contained in:
Chris Lu
2014-03-26 13:22:27 -07:00
parent 39b774a131
commit 59f6a13609
8 changed files with 123 additions and 31 deletions

View File

@@ -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)
}