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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save