fix: optimize DiskInfo() call avoid metrics when not needed (#17763)

This commit is contained in:
Harshavardhana
2023-07-31 15:20:48 -07:00
committed by GitHub
parent 8162fd1e20
commit 81be718674
27 changed files with 92 additions and 63 deletions

View File

@@ -65,7 +65,7 @@ type StorageAPI interface {
// returns 'nil' once healing is complete or if the disk
// has never been replaced.
Healing() *healingTracker
DiskInfo(ctx context.Context) (info DiskInfo, err error)
DiskInfo(ctx context.Context, metrics bool) (info DiskInfo, err error)
NSScanner(ctx context.Context, cache dataUsageCache, updates chan<- dataUsageEntry, scanMode madmin.HealScanMode) (dataUsageCache, error)
// Volume operations.
@@ -169,7 +169,7 @@ func (p *unrecognizedDisk) GetDiskID() (string, error) {
func (p *unrecognizedDisk) SetDiskID(id string) {
}
func (p *unrecognizedDisk) DiskInfo(ctx context.Context) (info DiskInfo, err error) {
func (p *unrecognizedDisk) DiskInfo(ctx context.Context, _ bool) (info DiskInfo, err error) {
return info, errDiskNotFound
}