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:
Harshavardhana
2021-03-02 17:28:04 -08:00
committed by GitHub
parent cd9e30c0f4
commit c6a120df0e
15 changed files with 169 additions and 66 deletions

View File

@@ -39,14 +39,17 @@ const (
// Add your own backend.
)
// ObjectLayerState - represents the status of the object layer
type ObjectLayerState string
// ItemState - represents the status of any item in offline,init,online state
type ItemState string
const (
// ObjectLayerInitializing indicates that the object layer is still in initialization phase
ObjectLayerInitializing = ObjectLayerState("initializing")
// ObjectLayerOnline indicates that the object layer is ready
ObjectLayerOnline = ObjectLayerState("online")
// ItemOffline indicates that the item is offline
ItemOffline = ItemState("offline")
// ItemInitializing indicates that the item is still in initialization phase
ItemInitializing = ItemState("initializing")
// ItemOnline indicates that the item is online
ItemOnline = ItemState("online")
)
// StorageInfo - represents total capacity of underlying storage.
@@ -171,7 +174,7 @@ func (adm *AdminClient) DataUsageInfo(ctx context.Context) (DataUsageInfo, error
// InfoMessage container to hold server admin related information.
type InfoMessage struct {
Mode ObjectLayerState `json:"mode,omitempty"`
Mode string `json:"mode,omitempty"`
Domain []string `json:"domain,omitempty"`
Region string `json:"region,omitempty"`
SQSARN []string `json:"sqsARN,omitempty"`