mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
fix: Prometheus metrics to re-use storage disks (#11647)
also re-use storage disks for all `mc admin server info` calls as well, implement a new LocalStorageInfo() API call at ObjectLayer to lookup local disks storageInfo also fixes bugs where there were double calls to StorageInfo()
This commit is contained in:
@@ -229,6 +229,18 @@ func (er erasureObjects) StorageInfo(ctx context.Context) (StorageInfo, []error)
|
||||
return getStorageInfo(disks, endpoints)
|
||||
}
|
||||
|
||||
// LocalStorageInfo - returns underlying local storage statistics.
|
||||
func (er erasureObjects) LocalStorageInfo(ctx context.Context) (StorageInfo, []error) {
|
||||
disks := er.getLocalDisks()
|
||||
endpoints := make([]string, len(disks))
|
||||
for i, disk := range disks {
|
||||
if disk != nil {
|
||||
endpoints[i] = disk.String()
|
||||
}
|
||||
}
|
||||
return getStorageInfo(disks, endpoints)
|
||||
}
|
||||
|
||||
func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, healing bool) {
|
||||
var wg sync.WaitGroup
|
||||
disks := er.getDisks()
|
||||
|
||||
Reference in New Issue
Block a user