Solaris disk support (#5638)

This commit is contained in:
Dominic Pearson
2024-06-03 07:10:28 +02:00
committed by GitHub
parent 579ebbdf60
commit d8bde9b96e
5 changed files with 47 additions and 8 deletions

17
weed/stats/disk_common.go Normal file
View File

@@ -0,0 +1,17 @@
package stats
import "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
func calculateDiskRemaining(disk *volume_server_pb.DiskStatus) {
disk.Used = disk.All - disk.Free
if disk.All > 0 {
disk.PercentFree = float32((float64(disk.Free) / float64(disk.All)) * 100)
disk.PercentUsed = float32((float64(disk.Used) / float64(disk.All)) * 100)
} else {
disk.PercentFree = 0
disk.PercentUsed = 0
}
return
}