mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
fix: admin info output and improve overall performance (#10015)
- admin info node offline check is now quicker - admin info now doesn't duplicate the code across doing the same checks for disks - rely on StorageInfo to return appropriate errors instead of calling locally. - diskID checks now return proper errors when disk not found v/s format.json missing. - add more disk states for more clarity on the underlying disk errors.
This commit is contained in:
19
cmd/fs-v1.go
19
cmd/fs-v1.go
@@ -53,9 +53,6 @@ var defaultEtag = "00000000000000000000000000000000-1"
|
||||
type FSObjects struct {
|
||||
GatewayUnsupported
|
||||
|
||||
// Disk usage metrics
|
||||
totalUsed uint64 // ref: https://golang.org/pkg/sync/atomic/#pkg-note-BUG
|
||||
|
||||
// The count of concurrent calls on FSObjects API
|
||||
activeIOCount int64
|
||||
// The active IO count ceiling for crawling to work
|
||||
@@ -215,15 +212,15 @@ func (fs *FSObjects) StorageInfo(ctx context.Context, _ bool) (StorageInfo, []er
|
||||
return StorageInfo{}, []error{err}
|
||||
}
|
||||
used := di.Total - di.Free
|
||||
if !fs.diskMount {
|
||||
used = atomic.LoadUint64(&fs.totalUsed)
|
||||
}
|
||||
|
||||
storageInfo := StorageInfo{
|
||||
Used: []uint64{used},
|
||||
Total: []uint64{di.Total},
|
||||
Available: []uint64{di.Free},
|
||||
MountPaths: []string{fs.fsPath},
|
||||
Disks: []madmin.Disk{
|
||||
{
|
||||
TotalSpace: di.Total,
|
||||
UsedSpace: used,
|
||||
AvailableSpace: di.Free,
|
||||
DrivePath: fs.fsPath,
|
||||
},
|
||||
},
|
||||
}
|
||||
storageInfo.Backend.Type = BackendFS
|
||||
return storageInfo, nil
|
||||
|
||||
Reference in New Issue
Block a user