collect ec volume deleted bytes

This commit is contained in:
chrislu committed 2025-08-10 12:37:18 -07:00
1 parent 3a9ec6f30c
commit fc666e2e48
6 files changed
+686 -287

No files matched your search

@@ -472,9 +472,14 @@ type VolumeInfo struct {
}
type VolumeStatus struct {
IsLeader bool `json:"IsLeader"`
Leader string `json:"Leader"`
Volumes []VolumeInfo `json:"Volumes"`
Version string `json:"Version"`
Volumes VolumeLayout `json:"Volumes"`
}
type VolumeLayout struct {
DataCenters map[string]map[string]map[string][]VolumeInfo `json:"DataCenters"`
Free int `json:"Free"`
Max int `json:"Max"`
}
func getVolumeStatusForDeletion() []VolumeInfo {
@@ -492,7 +497,20 @@ func getVolumeStatusForDeletion() []VolumeInfo {
return nil
}
return volumeStatus.Volumes
// Extract all volumes from the nested structure
var allVolumes []VolumeInfo
for dcName, dataCenter := range volumeStatus.Volumes.DataCenters {
log.Printf("Processing data center: %s", dcName)
for rackName, rack := range dataCenter {
log.Printf("Processing rack: %s", rackName)
for serverName, volumes := range rack {
log.Printf("Found %d volumes on server %s", len(volumes), serverName)
allVolumes = append(allVolumes, volumes...)
}
}
}
return allVolumes
}
type StoredFilePaths struct {