mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 00:03:29 +03:00
Expose total and available disk space (#7453)
This commit is contained in:
committed by
Nitish Tiwari
parent
979309148e
commit
0188009c7e
+8
-3
@@ -120,18 +120,23 @@ func getStorageInfo(disks []StorageAPI) StorageInfo {
|
||||
return StorageInfo{}
|
||||
}
|
||||
|
||||
// Combine all disks to get total usage.
|
||||
var used uint64
|
||||
// Combine all disks to get total usage
|
||||
var used, total, available uint64
|
||||
for _, di := range validDisksInfo {
|
||||
used = used + di.Used
|
||||
total = total + di.Total
|
||||
available = available + di.Free
|
||||
}
|
||||
|
||||
_, sscParity := getRedundancyCount(standardStorageClass, len(disks))
|
||||
_, rrscparity := getRedundancyCount(reducedRedundancyStorageClass, len(disks))
|
||||
|
||||
storageInfo := StorageInfo{
|
||||
Used: used,
|
||||
Used: used,
|
||||
Total: total,
|
||||
Available: available,
|
||||
}
|
||||
|
||||
storageInfo.Backend.Type = BackendErasure
|
||||
storageInfo.Backend.OnlineDisks = onlineDisks
|
||||
storageInfo.Backend.OfflineDisks = offlineDisks
|
||||
|
||||
Reference in New Issue
Block a user