diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-19 01:38:56 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-19 01:38:56 -0800 |
| commit | c576ad04aca940319ec6d41583c93398b68dbe58 (patch) | |
| tree | db4435270c25d4114a2946be53eaf275fdee7dc6 /weed/topology/data_node.go | |
| parent | c78409a5983145784d128c86541c6715dad3a937 (diff) | |
| download | seaweedfs-c576ad04aca940319ec6d41583c93398b68dbe58.tar.xz seaweedfs-c576ad04aca940319ec6d41583c93398b68dbe58.zip | |
fix volume server display for volumes
Diffstat (limited to 'weed/topology/data_node.go')
| -rw-r--r-- | weed/topology/data_node.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index 1a0ebf761..d4ec94fbe 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 } |
