process has NetIOCounters and IOCounters.

pull/177/head
Shirou WAKAYAMA 9 years ago
parent ea152ea901
commit 46ddd57c72

@ -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
}

@ -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
}

@ -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)
}

@ -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
}

@ -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 <<EOF
CPUTimesStat -> TimesStat
CPUInfoStat -> InfoStat

Loading…
Cancel
Save