aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/data_node.go
diff options
context:
space:
mode:
authorbingoohuang <bingoo.huang@gmail.com>2021-02-20 16:45:02 +0800
committerGitHub <noreply@github.com>2021-02-20 16:45:02 +0800
commitf69356f5890f28d102d807297f8a5da915435482 (patch)
treed5ee05dd243c1fa5d023a13f0e69d98b798802d9 /weed/topology/data_node.go
parent7ffe736d20f68cd0bd3d000649494e4550127c7d (diff)
parent565f7a6e724cf2dca401bd699a65f5814606ebfe (diff)
downloadseaweedfs-f69356f5890f28d102d807297f8a5da915435482.tar.xz
seaweedfs-f69356f5890f28d102d807297f8a5da915435482.zip
Merge pull request #3 from chrislusf/master
Diffstat (limited to 'weed/topology/data_node.go')
-rw-r--r--weed/topology/data_node.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go
index 1a0ebf761..69f739dd5 100644
--- a/weed/topology/data_node.go
+++ b/weed/topology/data_node.go
@@ -207,7 +207,26 @@ func (dn *DataNode) ToMap() interface{} {
ret := make(map[string]interface{})
ret["Url"] = dn.Url()
ret["PublicUrl"] = dn.PublicUrl
- ret["Disks"] = dn.diskUsages.ToMap()
+
+ // aggregated volume info
+ var volumeCount, ecShardCount, maxVolumeCount int64
+ var volumeIds string
+ for _, diskUsage := range dn.diskUsages.usages {
+ volumeCount += diskUsage.volumeCount
+ ecShardCount += diskUsage.ecShardCount
+ maxVolumeCount += diskUsage.maxVolumeCount
+ }
+
+ for _, disk := range dn.Children() {
+ d := disk.(*Disk)
+ volumeIds += " " + d.GetVolumeIds()
+ }
+
+ ret["Volumes"] = volumeCount
+ ret["EcShards"] = ecShardCount
+ ret["Max"] = maxVolumeCount
+ ret["VolumeIds"] = volumeIds
+
return ret
}