mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
metrics: Use StorageInfo() instead to have consistent info (#9006)
Metrics used to have its own code to calculate offline disks. StorageInfo() was avoided because it is an expensive operation by sending calls to all nodes. To make metrics & server info share the same code, a new argument `local` is added to StorageInfo() so it will only query local disks when needed. Metrics now calls StorageInfo() as server info handler does but with the local flag set to false. Co-authored-by: Praveen raj Mani <praveen@minio.io> Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
@@ -54,7 +54,7 @@ func printStartupSafeModeMessage(apiEndpoints []string, err error) {
|
||||
// Object layer is initialized then print StorageInfo in safe mode.
|
||||
objAPI := newObjectLayerWithoutSafeModeFn()
|
||||
if objAPI != nil {
|
||||
if msg := getStorageInfoMsgSafeMode(objAPI.StorageInfo(context.Background())); msg != "" {
|
||||
if msg := getStorageInfoMsgSafeMode(objAPI.StorageInfo(context.Background(), false)); msg != "" {
|
||||
logStartupMessage(msg)
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func printStartupMessage(apiEndpoints []string) {
|
||||
// Object layer is initialized then print StorageInfo.
|
||||
objAPI := newObjectLayerFn()
|
||||
if objAPI != nil {
|
||||
printStorageInfo(objAPI.StorageInfo(context.Background()))
|
||||
printStorageInfo(objAPI.StorageInfo(context.Background(), false))
|
||||
}
|
||||
|
||||
// Prints credential, region and browser access.
|
||||
|
||||
Reference in New Issue
Block a user