mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
update gopsutil to use the v3 API (#11638)
This commit is contained in:
@@ -27,9 +27,9 @@ import (
|
||||
|
||||
"github.com/minio/minio/pkg/disk"
|
||||
"github.com/minio/minio/pkg/madmin"
|
||||
cpuhw "github.com/shirou/gopsutil/cpu"
|
||||
memhw "github.com/shirou/gopsutil/mem"
|
||||
"github.com/shirou/gopsutil/process"
|
||||
cpuhw "github.com/shirou/gopsutil/v3/cpu"
|
||||
memhw "github.com/shirou/gopsutil/v3/mem"
|
||||
"github.com/shirou/gopsutil/v3/process"
|
||||
)
|
||||
|
||||
func getLocalCPUInfo(ctx context.Context, r *http.Request) madmin.ServerCPUInfo {
|
||||
@@ -264,11 +264,8 @@ func getLocalProcInfo(ctx context.Context, r *http.Request) madmin.ServerProcInf
|
||||
}
|
||||
sysProc.Name = name
|
||||
|
||||
netIOCounters, err := proc.NetIOCountersWithContext(ctx, false)
|
||||
if err != nil {
|
||||
return errProcInfo("netio-counters", err)
|
||||
}
|
||||
sysProc.NetIOCounters = netIOCounters
|
||||
// Refer for more information on NetIOCounters
|
||||
// is useless https://github.com/shirou/gopsutil/issues/429
|
||||
|
||||
nice, err := proc.NiceWithContext(ctx)
|
||||
if err != nil {
|
||||
@@ -310,17 +307,11 @@ func getLocalProcInfo(ctx context.Context, r *http.Request) madmin.ServerProcInf
|
||||
sysProc.Ppid = ppid
|
||||
}
|
||||
|
||||
rlimit, err := proc.RlimitWithContext(ctx)
|
||||
if err != nil {
|
||||
return errProcInfo("rlimit", err)
|
||||
}
|
||||
sysProc.Rlimit = rlimit
|
||||
|
||||
status, err := proc.StatusWithContext(ctx)
|
||||
if err != nil {
|
||||
return errProcInfo("status", err)
|
||||
}
|
||||
sysProc.Status = status
|
||||
sysProc.Status = status[0]
|
||||
|
||||
tgid, err := proc.Tgid()
|
||||
if err != nil {
|
||||
|
||||
@@ -27,8 +27,8 @@ import (
|
||||
|
||||
"github.com/minio/minio/pkg/madmin"
|
||||
"github.com/minio/minio/pkg/smart"
|
||||
diskhw "github.com/shirou/gopsutil/disk"
|
||||
"github.com/shirou/gopsutil/host"
|
||||
diskhw "github.com/shirou/gopsutil/v3/disk"
|
||||
"github.com/shirou/gopsutil/v3/host"
|
||||
)
|
||||
|
||||
func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo {
|
||||
@@ -102,7 +102,7 @@ func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskH
|
||||
Device: part.Device,
|
||||
Mountpoint: part.Mountpoint,
|
||||
Fstype: part.Fstype,
|
||||
Opts: part.Opts,
|
||||
Opts: strings.Join(part.Opts, ","),
|
||||
SmartInfo: smartInfo,
|
||||
}
|
||||
partitions = append(partitions, partition)
|
||||
|
||||
Reference in New Issue
Block a user