mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
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:
@@ -156,11 +156,13 @@ func loadProcessMetrics(ctx context.Context, m MetricValues, c *metricsCache) er
|
||||
m.Set(processUptimeSeconds, time.Since(globalBootTime).Seconds())
|
||||
}
|
||||
|
||||
p, err := procfs.Self()
|
||||
if err != nil {
|
||||
metricsLogIf(ctx, err)
|
||||
} else {
|
||||
loadProcFSMetrics(ctx, p, m)
|
||||
if runtime.GOOS != globalWindowsOSName && runtime.GOOS != globalMacOSName {
|
||||
p, err := procfs.Self()
|
||||
if err != nil {
|
||||
metricsLogIf(ctx, err)
|
||||
} else {
|
||||
loadProcFSMetrics(ctx, p, m)
|
||||
}
|
||||
}
|
||||
|
||||
if globalIsDistErasure && globalLockServer != nil {
|
||||
|
||||
Reference in New Issue
Block a user