add missing available space from metrics (#10065)

This commit is contained in:
Harshavardhana 2020-07-16 14:43:48 -07:00 committed by GitHub
parent 7342b5355f
commit d3c81a6e93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,12 +142,13 @@ func getDisksInfo(disks []StorageAPI, endpoints []string) (disksInfo []madmin.Di
}
}
di := madmin.Disk{
Endpoint: endpoints[index],
DrivePath: info.MountPath,
TotalSpace: info.Total,
UsedSpace: info.Used,
UUID: info.ID,
State: diskErrToDriveState(err),
Endpoint: endpoints[index],
DrivePath: info.MountPath,
TotalSpace: info.Total,
UsedSpace: info.Used,
AvailableSpace: info.Free,
UUID: info.ID,
State: diskErrToDriveState(err),
}
if info.Total > 0 {
di.Utilization = float64(info.Used / info.Total * 100)