Merge branch 'master' of github.com:shirou/gopsutil
This commit is contained in:
commit
ac570a47a1
31
README.rst
31
README.rst
|
@ -2,7 +2,9 @@ gopsutil: psutil for golang
|
|||
==============================
|
||||
|
||||
This is a port of psutil(http://pythonhosted.org/psutil/). This
|
||||
challenges port of all
|
||||
challenges porting all psutil functions on some architectures.
|
||||
|
||||
|
||||
|
||||
Available archtectures
|
||||
------------------------------------
|
||||
|
@ -49,6 +51,33 @@ Document
|
|||
see http://godoc.org/github.com/shirou/gopsutil
|
||||
|
||||
|
||||
Current Status
|
||||
------------------
|
||||
|
||||
- done
|
||||
|
||||
- cpu_times (linux)
|
||||
- cpu_count (linux, freebsd, windows)
|
||||
- virtual_memory (linux, windows)
|
||||
- swap_memory (linux)
|
||||
- disk_partitions (windows)
|
||||
- disk_usage (windows)
|
||||
- boot_time (linux, freebsd)
|
||||
|
||||
- not yet
|
||||
|
||||
- cpu_percent
|
||||
- cpu_times_percent
|
||||
- disk_io_counters
|
||||
- net_io_counters
|
||||
- net_connections
|
||||
- users
|
||||
- pids
|
||||
- pid_exists
|
||||
- process_iter
|
||||
- wait_procs
|
||||
- process class
|
||||
|
||||
License
|
||||
------------
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
func do_sysctrl(mib string) ([]string, error){
|
||||
func do_sysctrl(mib string) ([]string, error) {
|
||||
out, err := exec.Command("/sbin/sysctl", "-n", mib).Output()
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
|
|
|
@ -4,8 +4,8 @@ package gopsutil
|
|||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func HostInfo() (HostInfoStat, error) {
|
||||
|
@ -20,9 +20,8 @@ func HostInfo() (HostInfoStat, error) {
|
|||
return ret, nil
|
||||
}
|
||||
|
||||
|
||||
func Boot_time() (int64, error){
|
||||
values,err := do_sysctrl("kern.boottime")
|
||||
func Boot_time() (int64, error) {
|
||||
values, err := do_sysctrl("kern.boottime")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
func LoadAvg() (LoadAvgStat, error) {
|
||||
values,err := do_sysctrl("vm.loadavg")
|
||||
values, err := do_sysctrl("vm.loadavg")
|
||||
if err != nil {
|
||||
return LoadAvgStat{}, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue