mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
printout statistics
This commit is contained in:
parent
de7626bd22
commit
868913aa04
|
@ -42,7 +42,7 @@ func (c *commandVolumeList) Do(args []string, commandEnv *commandEnv, writer io.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeTopologyInfo(writer io.Writer, t *master_pb.TopologyInfo) statistics{
|
func writeTopologyInfo(writer io.Writer, t *master_pb.TopologyInfo) statistics {
|
||||||
fmt.Fprintf(writer, "Topology volume:%d/%d active:%d free:%d\n", t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
fmt.Fprintf(writer, "Topology volume:%d/%d active:%d free:%d\n", t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
||||||
var s statistics
|
var s statistics
|
||||||
for _, dc := range t.DataCenterInfos {
|
for _, dc := range t.DataCenterInfos {
|
||||||
|
@ -51,7 +51,7 @@ func writeTopologyInfo(writer io.Writer, t *master_pb.TopologyInfo) statistics{
|
||||||
fmt.Fprintf(writer, "%+v \n", s)
|
fmt.Fprintf(writer, "%+v \n", s)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
func writeDataCenterInfo(writer io.Writer, t *master_pb.DataCenterInfo) statistics{
|
func writeDataCenterInfo(writer io.Writer, t *master_pb.DataCenterInfo) statistics {
|
||||||
fmt.Fprintf(writer, " DataCenter %s volume:%d/%d active:%d free:%d\n", t.Id, t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
fmt.Fprintf(writer, " DataCenter %s volume:%d/%d active:%d free:%d\n", t.Id, t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
||||||
var s statistics
|
var s statistics
|
||||||
for _, r := range t.RackInfos {
|
for _, r := range t.RackInfos {
|
||||||
|
@ -60,7 +60,7 @@ func writeDataCenterInfo(writer io.Writer, t *master_pb.DataCenterInfo) statisti
|
||||||
fmt.Fprintf(writer, " DataCenter %s %+v \n", t.Id, s)
|
fmt.Fprintf(writer, " DataCenter %s %+v \n", t.Id, s)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
func writeRackInfo(writer io.Writer, t *master_pb.RackInfo) statistics{
|
func writeRackInfo(writer io.Writer, t *master_pb.RackInfo) statistics {
|
||||||
fmt.Fprintf(writer, " Rack %s volume:%d/%d active:%d free:%d\n", t.Id, t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
fmt.Fprintf(writer, " Rack %s volume:%d/%d active:%d free:%d\n", t.Id, t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
||||||
var s statistics
|
var s statistics
|
||||||
for _, dn := range t.DataNodeInfos {
|
for _, dn := range t.DataNodeInfos {
|
||||||
|
@ -69,7 +69,7 @@ func writeRackInfo(writer io.Writer, t *master_pb.RackInfo) statistics{
|
||||||
fmt.Fprintf(writer, " Rack %s %+v \n", t.Id, s)
|
fmt.Fprintf(writer, " Rack %s %+v \n", t.Id, s)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
func writeDataNodeInfo(writer io.Writer, t *master_pb.DataNodeInfo) statistics{
|
func writeDataNodeInfo(writer io.Writer, t *master_pb.DataNodeInfo) statistics {
|
||||||
fmt.Fprintf(writer, " DataNode %s volume:%d/%d active:%d free:%d\n", t.Id, t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
fmt.Fprintf(writer, " DataNode %s volume:%d/%d active:%d free:%d\n", t.Id, t.VolumeCount, t.MaxVolumeCount, t.ActiveVolumeCount, t.FreeVolumeCount)
|
||||||
var s statistics
|
var s statistics
|
||||||
for _, vi := range t.VolumeInfos {
|
for _, vi := range t.VolumeInfos {
|
||||||
|
@ -109,7 +109,7 @@ func (s statistics) plus(t statistics) statistics {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s statistics) String() string {
|
func (s statistics) String() string {
|
||||||
if s.DeletedFileCount>0 {
|
if s.DeletedFileCount > 0 {
|
||||||
return fmt.Sprintf("total size:%d file_count:%d deleted_file:%d deleted_bytes:%d", s.Size, s.FileCount, s.DeletedFileCount, s.DeletedBytes)
|
return fmt.Sprintf("total size:%d file_count:%d deleted_file:%d deleted_bytes:%d", s.Size, s.FileCount, s.DeletedFileCount, s.DeletedBytes)
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("total size:%d file_count:%d", s.Size, s.FileCount)
|
return fmt.Sprintf("total size:%d file_count:%d", s.Size, s.FileCount)
|
||||||
|
|
Loading…
Reference in a new issue