From 45aeaebda5dd016be3983f1bf904b18053fa2deb Mon Sep 17 00:00:00 2001 From: marcospedreiro Date: Sun, 18 Nov 2018 22:30:47 -0800 Subject: [PATCH] test windows cpu.Time(true) returning time instead of percentages --- README.rst | 2 +- cpu/cpu.go | 2 +- cpu/cpu_darwin_nocgo.go | 2 +- cpu/cpu_fallback.go | 2 +- cpu/cpu_freebsd.go | 2 +- cpu/cpu_freebsd_test.go | 2 +- cpu/cpu_linux.go | 2 +- cpu/cpu_openbsd.go | 2 +- cpu/cpu_solaris.go | 2 +- cpu/cpu_windows.go | 23 +++++++++++++++++++---- disk/disk.go | 2 +- disk/disk_darwin.go | 2 +- disk/disk_darwin_cgo.go | 2 +- disk/disk_darwin_nocgo.go | 2 +- disk/disk_fallback.go | 2 +- disk/disk_freebsd.go | 2 +- disk/disk_linux.go | 2 +- disk/disk_openbsd.go | 2 +- disk/disk_solaris.go | 2 +- disk/disk_unix.go | 2 +- disk/disk_windows.go | 2 +- docker/docker.go | 4 ++-- docker/docker_linux.go | 4 ++-- docker/docker_notlinux.go | 4 ++-- host/host.go | 2 +- host/host_darwin.go | 4 ++-- host/host_fallback.go | 2 +- host/host_freebsd.go | 4 ++-- host/host_linux.go | 2 +- host/host_openbsd.go | 4 ++-- host/host_solaris.go | 2 +- host/host_windows.go | 6 +++--- load/load.go | 2 +- load/load_darwin.go | 2 +- load/load_fallback.go | 2 +- load/load_linux.go | 2 +- load/load_windows.go | 2 +- mem/mem.go | 2 +- mem/mem_darwin.go | 2 +- mem/mem_fallback.go | 2 +- mem/mem_linux.go | 2 +- mem/mem_openbsd.go | 2 +- mem/mem_solaris.go | 2 +- mem/mem_windows.go | 2 +- net/net.go | 2 +- net/net_fallback.go | 2 +- net/net_freebsd.go | 2 +- net/net_linux.go | 6 +++--- net/net_linux_test.go | 2 +- net/net_openbsd.go | 2 +- net/net_test.go | 2 +- net/net_unix.go | 2 +- net/net_windows.go | 2 +- process/process.go | 6 +++--- process/process_darwin.go | 6 +++--- process/process_fallback.go | 6 +++--- process/process_freebsd.go | 6 +++--- process/process_linux.go | 8 ++++---- process/process_openbsd.go | 8 ++++---- process/process_test.go | 2 +- process/process_windows.go | 6 +++--- 61 files changed, 105 insertions(+), 90 deletions(-) diff --git a/README.rst b/README.rst index 63f5f69..521ead9 100644 --- a/README.rst +++ b/README.rst @@ -61,7 +61,7 @@ Note: gopsutil v2 breaks compatibility. If you want to stay with compatibility, import ( "fmt" - "github.com/shirou/gopsutil/mem" + "github.com/marcospedreiro/gopsutil/mem" ) func main() { diff --git a/cpu/cpu.go b/cpu/cpu.go index ceaf77f..9b989ec 100644 --- a/cpu/cpu.go +++ b/cpu/cpu.go @@ -10,7 +10,7 @@ import ( "sync" "time" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) // TimesStat contains the amounts of time the CPU has spent performing different diff --git a/cpu/cpu_darwin_nocgo.go b/cpu/cpu_darwin_nocgo.go index 242b4a8..5a77940 100644 --- a/cpu/cpu_darwin_nocgo.go +++ b/cpu/cpu_darwin_nocgo.go @@ -3,7 +3,7 @@ package cpu -import "github.com/shirou/gopsutil/internal/common" +import "github.com/marcospedreiro/gopsutil/internal/common" func perCPUTimes() ([]TimesStat, error) { return []TimesStat{}, common.ErrNotImplementedError diff --git a/cpu/cpu_fallback.go b/cpu/cpu_fallback.go index e9e7ada..fde93d6 100644 --- a/cpu/cpu_fallback.go +++ b/cpu/cpu_fallback.go @@ -5,7 +5,7 @@ package cpu import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Times(percpu bool) ([]TimesStat, error) { diff --git a/cpu/cpu_freebsd.go b/cpu/cpu_freebsd.go index b6c7186..4c6bd37 100644 --- a/cpu/cpu_freebsd.go +++ b/cpu/cpu_freebsd.go @@ -10,7 +10,7 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/unix" ) diff --git a/cpu/cpu_freebsd_test.go b/cpu/cpu_freebsd_test.go index c0ec73c..e2574ce 100644 --- a/cpu/cpu_freebsd_test.go +++ b/cpu/cpu_freebsd_test.go @@ -5,7 +5,7 @@ import ( "runtime" "testing" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func TestParseDmesgBoot(t *testing.T) { diff --git a/cpu/cpu_linux.go b/cpu/cpu_linux.go index 2fffe85..31a3d55 100644 --- a/cpu/cpu_linux.go +++ b/cpu/cpu_linux.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var CPUTick = float64(100) diff --git a/cpu/cpu_openbsd.go b/cpu/cpu_openbsd.go index 82b920f..1c358a6 100644 --- a/cpu/cpu_openbsd.go +++ b/cpu/cpu_openbsd.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/unix" ) diff --git a/cpu/cpu_solaris.go b/cpu/cpu_solaris.go index 117fd90..4b62565 100644 --- a/cpu/cpu_solaris.go +++ b/cpu/cpu_solaris.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var ClocksPerSec = float64(128) diff --git a/cpu/cpu_windows.go b/cpu/cpu_windows.go index 975c2cb..ad31bd1 100644 --- a/cpu/cpu_windows.go +++ b/cpu/cpu_windows.go @@ -8,7 +8,7 @@ import ( "unsafe" "github.com/StackExchange/wmi" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/windows" ) @@ -38,6 +38,20 @@ type win32_PerfFormattedData_Counters_ProcessorInformation struct { DPCRate uint32 } +type win32_PerfRawData_Counters_ProcessorInformation struct { + Name string + PercentDPCTime uint64 + PercentIdleTime uint64 + PercentUserTime uint64 + PercentProcessorTime uint64 + PercentInterruptTime uint64 + PercentPriorityTime uint64 + PercentPrivilegedTime uint64 + InterruptsPerSec uint32 + ProcessorFrequency uint32 + DPCRate uint32 +} + // Win32_PerfFormattedData_PerfOS_System struct to have count of processes and processor queue length type Win32_PerfFormattedData_PerfOS_System struct { Processes uint32 @@ -119,13 +133,14 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { // PerfInfo returns the performance counter's instance value for ProcessorInformation. // Name property is the key by which overall, per cpu and per core metric is known. -func perfInfoWithContext(ctx context.Context) ([]win32_PerfFormattedData_Counters_ProcessorInformation, error) { - var ret []win32_PerfFormattedData_Counters_ProcessorInformation +func perfInfoWithContext(ctx context.Context) ([]win32_PerfRawData_Counters_ProcessorInformation, error) { + var ret []win32_PerfRawData_Counters_ProcessorInformation + // Win32_PerfRawData_Counters_ProcessorInformation q := wmi.CreateQuery(&ret, "WHERE NOT Name LIKE '%_Total'") err := common.WMIQueryWithContext(ctx, q, &ret) if err != nil { - return []win32_PerfFormattedData_Counters_ProcessorInformation{}, err + return []win32_PerfRawData_Counters_ProcessorInformation{}, err } return ret, err diff --git a/disk/disk.go b/disk/disk.go index 38d8a8f..95f4645 100644 --- a/disk/disk.go +++ b/disk/disk.go @@ -3,7 +3,7 @@ package disk import ( "encoding/json" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/disk/disk_darwin.go b/disk/disk_darwin.go index 2b1d000..0369eb9 100644 --- a/disk/disk_darwin.go +++ b/disk/disk_darwin.go @@ -7,7 +7,7 @@ import ( "path" "unsafe" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_darwin_cgo.go b/disk/disk_darwin_cgo.go index 480e237..7ab3376 100644 --- a/disk/disk_darwin_cgo.go +++ b/disk/disk_darwin_cgo.go @@ -31,7 +31,7 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func IOCounters(names ...string) (map[string]IOCountersStat, error) { diff --git a/disk/disk_darwin_nocgo.go b/disk/disk_darwin_nocgo.go index fe76d83..efc30df 100644 --- a/disk/disk_darwin_nocgo.go +++ b/disk/disk_darwin_nocgo.go @@ -6,7 +6,7 @@ package disk import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func IOCounters(names ...string) (map[string]IOCountersStat, error) { diff --git a/disk/disk_fallback.go b/disk/disk_fallback.go index 22eb507..eebd62c 100644 --- a/disk/disk_fallback.go +++ b/disk/disk_fallback.go @@ -5,7 +5,7 @@ package disk import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func IOCounters(names ...string) (map[string]IOCountersStat, error) { diff --git a/disk/disk_freebsd.go b/disk/disk_freebsd.go index 2e0966a..1f898f3 100644 --- a/disk/disk_freebsd.go +++ b/disk/disk_freebsd.go @@ -12,7 +12,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Partitions(all bool) ([]PartitionStat, error) { diff --git a/disk/disk_linux.go b/disk/disk_linux.go index 1b10a38..e7121b3 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -14,7 +14,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) const ( diff --git a/disk/disk_openbsd.go b/disk/disk_openbsd.go index 6fdf386..c4d647d 100644 --- a/disk/disk_openbsd.go +++ b/disk/disk_openbsd.go @@ -9,7 +9,7 @@ import ( "path" "unsafe" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_solaris.go b/disk/disk_solaris.go index c660835..4b645ca 100644 --- a/disk/disk_solaris.go +++ b/disk/disk_solaris.go @@ -10,7 +10,7 @@ import ( "os" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/unix" ) diff --git a/disk/disk_unix.go b/disk/disk_unix.go index 9b499b5..e841902 100644 --- a/disk/disk_unix.go +++ b/disk/disk_unix.go @@ -51,7 +51,7 @@ func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) { ret.UsedPercent = 0 } else { // We don't use ret.Total to calculate percent. - // see https://github.com/shirou/gopsutil/issues/562 + // see https://github.com/marcospedreiro/gopsutil/issues/562 ret.UsedPercent = (float64(ret.Used) / float64(ret.Used+ret.Free)) * 100.0 } diff --git a/disk/disk_windows.go b/disk/disk_windows.go index 326bc1f..0e57fe6 100644 --- a/disk/disk_windows.go +++ b/disk/disk_windows.go @@ -7,7 +7,7 @@ import ( "context" "unsafe" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/windows" ) diff --git a/docker/docker.go b/docker/docker.go index 912f933..d551b15 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -4,8 +4,8 @@ import ( "encoding/json" "errors" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" ) var ErrDockerNotAvailable = errors.New("docker not available") diff --git a/docker/docker_linux.go b/docker/docker_linux.go index 3f5a361..fad3707 100644 --- a/docker/docker_linux.go +++ b/docker/docker_linux.go @@ -11,8 +11,8 @@ import ( "strconv" "strings" - cpu "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" + cpu "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" ) // GetDockerStat returns a list of Docker basic stats. diff --git a/docker/docker_notlinux.go b/docker/docker_notlinux.go index dde104c..0d4fddf 100644 --- a/docker/docker_notlinux.go +++ b/docker/docker_notlinux.go @@ -5,8 +5,8 @@ package docker import ( "context" - cpu "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" + cpu "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" ) // GetDockerStat returns a list of Docker basic stats. diff --git a/host/host.go b/host/host.go index 1e9e9bb..94d7fa8 100644 --- a/host/host.go +++ b/host/host.go @@ -3,7 +3,7 @@ package host import ( "encoding/json" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/host/host_darwin.go b/host/host_darwin.go index 8241fc0..206965e 100644 --- a/host/host_darwin.go +++ b/host/host_darwin.go @@ -16,8 +16,8 @@ import ( "time" "unsafe" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/process" + "github.com/marcospedreiro/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/process" ) // from utmpx.h diff --git a/host/host_fallback.go b/host/host_fallback.go index e80d7ea..072bbca 100644 --- a/host/host_fallback.go +++ b/host/host_fallback.go @@ -5,7 +5,7 @@ package host import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Info() (*InfoStat, error) { diff --git a/host/host_freebsd.go b/host/host_freebsd.go index 00a8519..1e34b98 100644 --- a/host/host_freebsd.go +++ b/host/host_freebsd.go @@ -15,8 +15,8 @@ import ( "time" "unsafe" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/process" + "github.com/marcospedreiro/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/process" "golang.org/x/sys/unix" ) diff --git a/host/host_linux.go b/host/host_linux.go index 2c1ac6b..0c60216 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -18,7 +18,7 @@ import ( "sync/atomic" "time" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) type LSB struct { diff --git a/host/host_openbsd.go b/host/host_openbsd.go index 2ad64d7..89568d4 100644 --- a/host/host_openbsd.go +++ b/host/host_openbsd.go @@ -15,8 +15,8 @@ import ( "time" "unsafe" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/process" + "github.com/marcospedreiro/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/process" ) const ( diff --git a/host/host_solaris.go b/host/host_solaris.go index bb83bfc..5e366a0 100644 --- a/host/host_solaris.go +++ b/host/host_solaris.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Info() (*InfoStat, error) { diff --git a/host/host_windows.go b/host/host_windows.go index d89e191..f0ec5a0 100644 --- a/host/host_windows.go +++ b/host/host_windows.go @@ -15,8 +15,8 @@ import ( "unsafe" "github.com/StackExchange/wmi" - "github.com/shirou/gopsutil/internal/common" - process "github.com/shirou/gopsutil/process" + "github.com/marcospedreiro/gopsutil/internal/common" + process "github.com/marcospedreiro/gopsutil/process" "golang.org/x/sys/windows" ) @@ -102,7 +102,7 @@ func InfoWithContext(ctx context.Context) (*InfoStat, error) { } func getMachineGuid() (string, error) { - // there has been reports of issues on 32bit using golang.org/x/sys/windows/registry, see https://github.com/shirou/gopsutil/pull/312#issuecomment-277422612 + // there has been reports of issues on 32bit using golang.org/x/sys/windows/registry, see https://github.com/marcospedreiro/gopsutil/pull/312#issuecomment-277422612 // for rationale of using windows.RegOpenKeyEx/RegQueryValueEx instead of registry.OpenKey/GetStringValue var h windows.Handle err := windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, windows.StringToUTF16Ptr(`SOFTWARE\Microsoft\Cryptography`), 0, windows.KEY_READ|windows.KEY_WOW64_64KEY, &h) diff --git a/load/load.go b/load/load.go index 9085889..49e2b4b 100644 --- a/load/load.go +++ b/load/load.go @@ -3,7 +3,7 @@ package load import ( "encoding/json" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/load/load_darwin.go b/load/load_darwin.go index cd7b74d..b4d377b 100644 --- a/load/load_darwin.go +++ b/load/load_darwin.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Avg() (*AvgStat, error) { diff --git a/load/load_fallback.go b/load/load_fallback.go index 1e3ade0..cd4f182 100644 --- a/load/load_fallback.go +++ b/load/load_fallback.go @@ -5,7 +5,7 @@ package load import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Avg() (*AvgStat, error) { diff --git a/load/load_linux.go b/load/load_linux.go index 63c26a2..f8cf3d5 100644 --- a/load/load_linux.go +++ b/load/load_linux.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Avg() (*AvgStat, error) { diff --git a/load/load_windows.go b/load/load_windows.go index 42968b3..32e4e21 100644 --- a/load/load_windows.go +++ b/load/load_windows.go @@ -5,7 +5,7 @@ package load import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func Avg() (*AvgStat, error) { diff --git a/mem/mem.go b/mem/mem.go index e505662..cfaa56a 100644 --- a/mem/mem.go +++ b/mem/mem.go @@ -3,7 +3,7 @@ package mem import ( "encoding/json" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/mem/mem_darwin.go b/mem/mem_darwin.go index 4fe7009..3c1f3bb 100644 --- a/mem/mem_darwin.go +++ b/mem/mem_darwin.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/unix" ) diff --git a/mem/mem_fallback.go b/mem/mem_fallback.go index 2a0fd45..4bda295 100644 --- a/mem/mem_fallback.go +++ b/mem/mem_fallback.go @@ -5,7 +5,7 @@ package mem import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func VirtualMemory() (*VirtualMemoryStat, error) { diff --git a/mem/mem_linux.go b/mem/mem_linux.go index fcc9a3f..fbef03e 100644 --- a/mem/mem_linux.go +++ b/mem/mem_linux.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/unix" ) diff --git a/mem/mem_openbsd.go b/mem/mem_openbsd.go index 35472a3..aac01ea 100644 --- a/mem/mem_openbsd.go +++ b/mem/mem_openbsd.go @@ -10,7 +10,7 @@ import ( "fmt" "os/exec" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func GetPageSize() (uint64, error) { diff --git a/mem/mem_solaris.go b/mem/mem_solaris.go index 0736bc4..714f52c 100644 --- a/mem/mem_solaris.go +++ b/mem/mem_solaris.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) // VirtualMemory for Solaris is a minimal implementation which only returns diff --git a/mem/mem_windows.go b/mem/mem_windows.go index cfdf8bd..21170f0 100644 --- a/mem/mem_windows.go +++ b/mem/mem_windows.go @@ -6,7 +6,7 @@ import ( "context" "unsafe" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/windows" ) diff --git a/net/net.go b/net/net.go index fce86c7..8e7abc1 100644 --- a/net/net.go +++ b/net/net.go @@ -9,7 +9,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/net/net_fallback.go b/net/net_fallback.go index 7c5e632..af9f572 100644 --- a/net/net_fallback.go +++ b/net/net_fallback.go @@ -5,7 +5,7 @@ package net import ( "context" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/net/net_freebsd.go b/net/net_freebsd.go index ce02415..a0627d5 100644 --- a/net/net_freebsd.go +++ b/net/net_freebsd.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/net/net_linux.go b/net/net_linux.go index 616c10a..6311270 100644 --- a/net/net_linux.go +++ b/net/net_linux.go @@ -15,7 +15,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) // NetIOCounters returnes network I/O statistics for every network @@ -661,7 +661,7 @@ func processInet(file string, kind netConnectionKindType, inodes map[string][]in // Read the contents of the /proc file with a single read sys call. // This minimizes duplicates in the returned connections // For more info: - // https://github.com/shirou/gopsutil/pull/361 + // https://github.com/marcospedreiro/gopsutil/pull/361 contents, err := ioutil.ReadFile(file) if err != nil { return nil, err @@ -722,7 +722,7 @@ func processUnix(file string, kind netConnectionKindType, inodes map[string][]in // Read the contents of the /proc file with a single read sys call. // This minimizes duplicates in the returned connections // For more info: - // https://github.com/shirou/gopsutil/pull/361 + // https://github.com/marcospedreiro/gopsutil/pull/361 contents, err := ioutil.ReadFile(file) if err != nil { return nil, err diff --git a/net/net_linux_test.go b/net/net_linux_test.go index 566a17b..088aaa1 100644 --- a/net/net_linux_test.go +++ b/net/net_linux_test.go @@ -8,7 +8,7 @@ import ( "syscall" "testing" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "github.com/stretchr/testify/assert" ) diff --git a/net/net_openbsd.go b/net/net_openbsd.go index 3e74e8f..c4cc257 100644 --- a/net/net_openbsd.go +++ b/net/net_openbsd.go @@ -12,7 +12,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) var portMatch = regexp.MustCompile(`(.*)\.(\d+)$`) diff --git a/net/net_test.go b/net/net_test.go index 80f56af..3d69fff 100644 --- a/net/net_test.go +++ b/net/net_test.go @@ -6,7 +6,7 @@ import ( "runtime" "testing" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) func TestAddrString(t *testing.T) { diff --git a/net/net_unix.go b/net/net_unix.go index 4451b54..7df3fdd 100644 --- a/net/net_unix.go +++ b/net/net_unix.go @@ -6,7 +6,7 @@ import ( "context" "strings" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" ) // Return a list of network connections opened. diff --git a/net/net_windows.go b/net/net_windows.go index 61eb6ec..220833b 100644 --- a/net/net_windows.go +++ b/net/net_windows.go @@ -11,7 +11,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "golang.org/x/sys/windows" ) diff --git a/process/process.go b/process/process.go index a4b24f4..101890a 100644 --- a/process/process.go +++ b/process/process.go @@ -7,9 +7,9 @@ import ( "runtime" "time" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/mem" + "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/mem" ) var ( diff --git a/process/process_darwin.go b/process/process_darwin.go index 509ab3b..594af3c 100644 --- a/process/process_darwin.go +++ b/process/process_darwin.go @@ -13,9 +13,9 @@ import ( "time" "unsafe" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/net" + "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/net" "golang.org/x/sys/unix" ) diff --git a/process/process_fallback.go b/process/process_fallback.go index ca8b72f..c4ac06c 100644 --- a/process/process_fallback.go +++ b/process/process_fallback.go @@ -6,9 +6,9 @@ import ( "context" "syscall" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/net" + "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/net" ) type MemoryMapsStat struct { diff --git a/process/process_freebsd.go b/process/process_freebsd.go index af2b3b1..5952588 100644 --- a/process/process_freebsd.go +++ b/process/process_freebsd.go @@ -8,9 +8,9 @@ import ( "encoding/binary" "strings" - cpu "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" - net "github.com/shirou/gopsutil/net" + cpu "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" + net "github.com/marcospedreiro/gopsutil/net" "golang.org/x/sys/unix" ) diff --git a/process/process_linux.go b/process/process_linux.go index f844101..d33ff0c 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -15,10 +15,10 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/host" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/net" + "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/host" + "github.com/marcospedreiro/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/net" "golang.org/x/sys/unix" ) diff --git a/process/process_openbsd.go b/process/process_openbsd.go index b7b2cba..1ce2c99 100644 --- a/process/process_openbsd.go +++ b/process/process_openbsd.go @@ -10,10 +10,10 @@ import ( "strings" "unsafe" - cpu "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" - mem "github.com/shirou/gopsutil/mem" - net "github.com/shirou/gopsutil/net" + cpu "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" + mem "github.com/marcospedreiro/gopsutil/mem" + net "github.com/marcospedreiro/gopsutil/net" "golang.org/x/sys/unix" ) diff --git a/process/process_test.go b/process/process_test.go index a95efc2..0f3c4ac 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/shirou/gopsutil/internal/common" + "github.com/marcospedreiro/gopsutil/internal/common" "github.com/stretchr/testify/assert" ) diff --git a/process/process_windows.go b/process/process_windows.go index 82aed37..9443808 100644 --- a/process/process_windows.go +++ b/process/process_windows.go @@ -12,9 +12,9 @@ import ( "unsafe" "github.com/StackExchange/wmi" - cpu "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" - net "github.com/shirou/gopsutil/net" + cpu "github.com/marcospedreiro/gopsutil/cpu" + "github.com/marcospedreiro/gopsutil/internal/common" + net "github.com/marcospedreiro/gopsutil/net" "github.com/shirou/w32" "golang.org/x/sys/windows" )