move DiskStatus and MemStatus to protobuf

This commit is contained in:
Chris Lu
2018-10-15 22:25:28 -07:00
parent eec951cad2
commit 46eb77f9bb
10 changed files with 242 additions and 86 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb"
)
func (vs *VolumeServer) statusHandler(w http.ResponseWriter, r *http.Request) {
@@ -18,7 +19,7 @@ func (vs *VolumeServer) statusHandler(w http.ResponseWriter, r *http.Request) {
func (vs *VolumeServer) statsDiskHandler(w http.ResponseWriter, r *http.Request) {
m := make(map[string]interface{})
m["Version"] = util.VERSION
var ds []*stats.DiskStatus
var ds []*volume_server_pb.DiskStatus
for _, loc := range vs.store.Locations {
if dir, e := filepath.Abs(loc.Directory); e == nil {
ds = append(ds, stats.NewDiskStatus(dir))