Better reporting of total/free usable capacity of the cluster (#15230)

The current code uses approximation using a ratio. The approximation 
can skew if we have multiple pools with different disk capacities.

Replace the algorithm with a simpler one which counts data 
disks and ignore parity disks.
This commit is contained in:
Anis Elleuch
2022-07-06 21:29:49 +01:00
committed by GitHub
parent dd839bf295
commit 8d98282afd
7 changed files with 39 additions and 27 deletions
+2 -2
View File
@@ -577,7 +577,7 @@ func storageMetricsPrometheus(ch chan<- prometheus.Metric) {
"Total usable capacity online in the cluster",
nil, nil),
prometheus.GaugeValue,
GetTotalUsableCapacity(server.Disks, s),
float64(GetTotalUsableCapacity(server.Disks, s)),
)
// Report total usable capacity free
ch <- prometheus.MustNewConstMetric(
@@ -586,7 +586,7 @@ func storageMetricsPrometheus(ch chan<- prometheus.Metric) {
"Total free usable capacity online in the cluster",
nil, nil),
prometheus.GaugeValue,
GetTotalUsableCapacityFree(server.Disks, s),
float64(GetTotalUsableCapacityFree(server.Disks, s)),
)
// MinIO Offline Disks per node