Merge branch 'master' of github.com:shirou/gopsutil

pull/4/head
WAKAYAMA shirou 11 years ago
commit 2d7a081554

@ -4,8 +4,6 @@ gopsutil: psutil for golang
This is a port of psutil(http://pythonhosted.org/psutil/). This This is a port of psutil(http://pythonhosted.org/psutil/). This
challenges porting all psutil functions on some architectures. challenges porting all psutil functions on some architectures.
Available archtectures Available archtectures
------------------------------------ ------------------------------------
@ -15,6 +13,10 @@ Available archtectures
(I do not have a darwin machine) (I do not have a darwin machine)
All works are implemented without cgo by porting c struct to golang struct.
usage usage
--------- ---------

@ -0,0 +1,27 @@
package gopsutil
type Net_io_countersStat struct {
Bytes_sent uint64 `json:"bytes_sent""` // number of bytes sent
Bytes_recv uint64 `json:"bytes_recv"` // number of bytes received
Packets_sent uint64 `json:"packets_sent"` // number of packets sent
Packets_recv uint64 `json:"packets_recv"` // number of packets received
Errin uint64 `json:"errin"` // total number of errors while receiving
Errout uint64 `json:"errout"` // total number of errors while sending
Dropin uint64 `json:"dropin"` // total number of incoming packets which were dropped
Dropout uint64 `json:"dropout"` // total number of outgoing packets which were dropped (always 0 on OSX and BSD)
}
type Addr struct {
Ip string `json:"ip""`
Port uint32 `json:"port""`
}
type Net_connectionStat struct {
Fd uint32 `json:"fd""`
Family uint32 `json:"family""`
Type uint32 `json:"type""`
Laddr Addr `json:"laddr""`
Raddr Addr `json:"raddr""`
Status string `json:"status""`
Pid int32 `json:"pid""`
}

@ -32,19 +32,10 @@ type Process struct {
Memory_maps []Memory_mapsStat Memory_maps []Memory_mapsStat
// Children []Process // FIXME: recursive // Children []Process // FIXME: recursive
Open_files []Open_filesStat Open_files []Open_filesStat
Connections []ConnectionStat Connections []Net_connectionStat
Is_running bool Is_running bool
} }
type ConnectionStat struct {
Fd uint32
Family uint32
Type uint32
Laddr string // FIXME
Raddr string // FIXME
Status string
}
type Open_filesStat struct { type Open_filesStat struct {
Path string Path string
Fd uint32 Fd uint32

Loading…
Cancel
Save