From 46ddd57c7224318f5b236426a81a57a19fef9e59 Mon Sep 17 00:00:00 2001 From: Shirou WAKAYAMA Date: Tue, 22 Mar 2016 23:23:08 +0900 Subject: [PATCH] process has NetIOCounters and IOCounters. --- process/process_darwin.go | 2 +- process/process_freebsd.go | 2 +- process/process_linux.go | 2 +- process/process_windows.go | 2 +- v2migration.sh | 7 +++++++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/process/process_darwin.go b/process/process_darwin.go index 9a65163c..a40034a0 100644 --- a/process/process_darwin.go +++ b/process/process_darwin.go @@ -315,7 +315,7 @@ func (p *Process) Connections() ([]net.ConnectionStat, error) { return net.ConnectionsPid("all", p.Pid) } -func (p *Process) IOCounters(pernic bool) ([]net.IOCountersStat, error) { +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { return nil, common.NotImplementedError } diff --git a/process/process_freebsd.go b/process/process_freebsd.go index c2900bc4..dcde1d69 100644 --- a/process/process_freebsd.go +++ b/process/process_freebsd.go @@ -242,7 +242,7 @@ func (p *Process) Connections() ([]net.ConnectionStat, error) { return nil, common.NotImplementedError } -func (p *Process) IOCounters(pernic bool) ([]net.IOCountersStat, error) { +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { return nil, common.NotImplementedError } diff --git a/process/process_linux.go b/process/process_linux.go index 9acf682e..d8089d1d 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -258,7 +258,7 @@ func (p *Process) Connections() ([]net.ConnectionStat, error) { return net.ConnectionsPid("all", p.Pid) } -func (p *Process) IOCounters(pernic bool) ([]net.IOCountersStat, error) { +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { filename := common.HostProc(strconv.Itoa(int(p.Pid)), "net/dev") return net.IOCountersByFile(pernic, filename) } diff --git a/process/process_windows.go b/process/process_windows.go index 3bf275cf..51bda278 100644 --- a/process/process_windows.go +++ b/process/process_windows.go @@ -252,7 +252,7 @@ func (p *Process) Connections() ([]net.ConnectionStat, error) { return nil, common.NotImplementedError } -func (p *Process) IOCounters(pernic bool) ([]net.IOCountersStat, error) { +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { return nil, common.NotImplementedError } diff --git a/v2migration.sh b/v2migration.sh index 7b477f05..70103bd7 100644 --- a/v2migration.sh +++ b/v2migration.sh @@ -2,6 +2,13 @@ # # go get golang.org/x/tools/cmd/gorename +# +# Note: +# process has IOCounters() for file IO, and also NetIOCounters() for Net IO. +# This scripts replace process.NetIOCounters() to IOCounters(). +# So you need hand-fixing process. + + TARGETS=`cat < TimesStat CPUInfoStat -> InfoStat