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:
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…
x
Reference in New Issue
Block a user