pull/1208/head
mmorel-35 3 years ago
parent 04c870cb3d
commit eb5f6203d8

@ -60,7 +60,7 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
Mhz: float64(c.ProcessorHz / 1000000), Mhz: float64(c.ProcessorHz / 1000000),
Cores: int32(c.NCpusCfg), Cores: int32(c.NCpusCfg),
} }
result := []InfoStat{info}; result := []InfoStat{info}
return result, nil return result, nil
} }
@ -71,4 +71,3 @@ func CountsWithContext(ctx context.Context, logical bool) (int, error) {
} }
return c.NCpusCfg, nil return c.NCpusCfg, nil
} }

@ -7,8 +7,8 @@ import (
"fmt" "fmt"
"unsafe" "unsafe"
"github.com/yusufpapurcu/wmi"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v3/internal/common"
"github.com/yusufpapurcu/wmi"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

@ -27,14 +27,14 @@ var (
// A blacklist of read-only virtual filesystems. Writable filesystems are of // A blacklist of read-only virtual filesystems. Writable filesystems are of
// operational concern and must not be included in this list. // operational concern and must not be included in this list.
fsTypeBlacklist = map[string]struct{}{ fsTypeBlacklist = map[string]struct{}{
"ctfs": struct{}{}, "ctfs": {},
"dev": struct{}{}, "dev": {},
"fd": struct{}{}, "fd": {},
"lofs": struct{}{}, "lofs": {},
"lxproc": struct{}{}, "lxproc": {},
"mntfs": struct{}{}, "mntfs": {},
"objfs": struct{}{}, "objfs": {},
"proc": struct{}{}, "proc": {},
} }
) )

@ -13,9 +13,9 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/yusufpapurcu/wmi"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v3/internal/common"
"github.com/shirou/gopsutil/v3/process" "github.com/shirou/gopsutil/v3/process"
"github.com/yusufpapurcu/wmi"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

@ -68,4 +68,3 @@ func MiscWithContext(ctx context.Context) (*MiscStat, error) {
} }
return &ret, nil return &ret, nil
} }

@ -21,10 +21,10 @@ func TestIOCountersByFileParsing(t *testing.T) {
assert.Nil(t, err, "Temporary file creation failed: ", err) assert.Nil(t, err, "Temporary file creation failed: ", err)
cases := [4][2]string{ cases := [4][2]string{
[2]string{"eth0: ", "eth1: "}, {"eth0: ", "eth1: "},
[2]string{"eth0:0: ", "eth1:0: "}, {"eth0:0: ", "eth1:0: "},
[2]string{"eth0:", "eth1:"}, {"eth0:", "eth1:"},
[2]string{"eth0:0:", "eth1:0:"}, {"eth0:0:", "eth1:0:"},
} }
for _, testCase := range cases { for _, testCase := range cases {
err = tmpfile.Truncate(0) err = tmpfile.Truncate(0)

@ -333,7 +333,6 @@ func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackSta
return nil, common.ErrNotImplementedError return nil, common.ErrNotImplementedError
} }
// NetProtoCounters returns network statistics for the entire system // NetProtoCounters returns network statistics for the entire system
// If protocols is empty then all protocols are returned, otherwise // If protocols is empty then all protocols are returned, otherwise
// just the protocols in the list are returned. // just the protocols in the list are returned.

@ -946,7 +946,6 @@ func getProcessCPUTimes(pid int32) (SYSTEM_TIMES, error) {
return times, err return times, err
} }
func getUserProcessParams32(handle windows.Handle) (rtlUserProcessParameters32, error) { func getUserProcessParams32(handle windows.Handle) (rtlUserProcessParameters32, error) {
pebAddress, err := queryPebAddress(syscall.Handle(handle), true) pebAddress, err := queryPebAddress(syscall.Handle(handle), true)
if err != nil { if err != nil {

Loading…
Cancel
Save