fix errors in metrics code on macos (#19965)

- do not load proc fs metrics in case of macos
- null-check TimeStat before accessing
This commit is contained in:
Shireesh Anjal
2024-06-20 23:25:03 +05:30
committed by GitHub
parent fae563b85d
commit e200808ab7
3 changed files with 19 additions and 15 deletions

View File

@@ -1688,7 +1688,7 @@ func getMinioProcMetrics() *MetricsGroupV2 {
cacheInterval: 10 * time.Second,
}
mg.RegisterRead(func(ctx context.Context) (metrics []MetricV2) {
if runtime.GOOS == "windows" {
if runtime.GOOS == globalWindowsOSName || runtime.GOOS == globalMacOSName {
return nil
}