diff options
| author | bingoohuang <bingoo.huang@gmail.com> | 2021-02-20 16:45:02 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-20 16:45:02 +0800 |
| commit | f69356f5890f28d102d807297f8a5da915435482 (patch) | |
| tree | d5ee05dd243c1fa5d023a13f0e69d98b798802d9 /weed/topology/data_node.go | |
| parent | 7ffe736d20f68cd0bd3d000649494e4550127c7d (diff) | |
| parent | 565f7a6e724cf2dca401bd699a65f5814606ebfe (diff) | |
| download | seaweedfs-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.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..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 } |
