1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

process has NetIOCounters and IOCounters.

This commit is contained in:
Shirou WAKAYAMA 2016-03-22 23:23:08 +09:00
parent ea152ea901
commit 46ddd57c72
5 changed files with 11 additions and 4 deletions

View File

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

View File

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

View File

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

View File

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

View File

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