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 {
+27 -32
View File
@@ -1,37 +1,32 @@
{
"file_paths": [
"/ec_test/large_file_1754816105_0.dat",
"/ec_test/large_file_1754816105_1.dat",
"/ec_test/large_file_1754816105_2.dat",
"/ec_test/large_file_1754816105_3.dat",
"/ec_test/large_file_1754816105_4.dat",
"/ec_test/large_file_1754816105_5.dat",
"/ec_test/large_file_1754816105_6.dat",
"/ec_test/large_file_1754816105_7.dat",
"/ec_test/large_file_1754816105_8.dat",
"/ec_test/large_file_1754816105_9.dat",
"/ec_test/large_file_1754816105_10.dat",
"/ec_test/large_file_1754816105_11.dat",
"/ec_test/large_file_1754816105_12.dat",
"/ec_test/large_file_1754816106_13.dat",
"/ec_test/large_file_1754816106_14.dat",
"/ec_test/large_file_1754816106_15.dat",
"/ec_test/large_file_1754816106_16.dat",
"/ec_test/large_file_1754816106_17.dat",
"/ec_test/large_file_1754816106_18.dat",
"/ec_test/large_file_1754816106_19.dat",
"/ec_test/large_file_1754816106_20.dat",
"/ec_test/large_file_1754816106_21.dat",
"/ec_test/large_file_1754816106_22.dat",
"/ec_test/large_file_1754816106_23.dat",
"/ec_test/large_file_1754816106_24.dat",
"/ec_test/large_file_1754816106_25.dat",
"/ec_test/large_file_1754816106_26.dat",
"/ec_test/large_file_1754816106_27.dat",
"/ec_test/large_file_1754816106_28.dat",
"/ec_test/large_file_1754816106_29.dat"
"/ec_test/large_file_1754854356_0.dat",
"/ec_test/large_file_1754854356_1.dat",
"/ec_test/large_file_1754854356_2.dat",
"/ec_test/large_file_1754854356_3.dat",
"/ec_test/large_file_1754854356_4.dat",
"/ec_test/large_file_1754854356_5.dat",
"/ec_test/large_file_1754854356_6.dat",
"/ec_test/large_file_1754854356_7.dat",
"/ec_test/large_file_1754854356_8.dat",
"/ec_test/large_file_1754854356_9.dat",
"/ec_test/large_file_1754854356_10.dat",
"/ec_test/large_file_1754854356_11.dat",
"/ec_test/large_file_1754854356_12.dat",
"/ec_test/large_file_1754854356_13.dat",
"/ec_test/large_file_1754854356_14.dat",
"/ec_test/large_file_1754854356_15.dat",
"/ec_test/large_file_1754854356_16.dat",
"/ec_test/large_file_1754854356_17.dat",
"/ec_test/large_file_1754854357_18.dat",
"/ec_test/large_file_1754854357_19.dat",
"/ec_test/large_file_1754854357_20.dat",
"/ec_test/large_file_1754854357_21.dat",
"/ec_test/large_file_1754854357_22.dat",
"/ec_test/large_file_1754854357_23.dat",
"/ec_test/large_file_1754854357_24.dat"
],
"timestamp": "2025-08-10T08:55:06.363144049Z",
"file_count": 30,
"timestamp": "2025-08-10T19:32:37.127812169Z",
"file_count": 25,
"file_size_kb": 3000
}