From 6d291867b800e04b5260eb33115ad6698acfd4e4 Mon Sep 17 00:00:00 2001 From: WAKAYAMA shirou Date: Tue, 22 Apr 2014 12:38:12 +0900 Subject: [PATCH 1/2] update README about current status. --- README.rst | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e0abe67..d740300 100644 --- a/README.rst +++ b/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 ------------ From 7d1ba2a9df5df43db9639e1961197304878c28cb Mon Sep 17 00:00:00 2001 From: WAKAYAMA shirou Date: Tue, 22 Apr 2014 12:43:31 +0900 Subject: [PATCH 2/2] go fmt --- common_freebsd.go | 2 +- host_freebsd.go | 7 +++---- host_linux.go | 3 +-- load_freebsd.go | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/common_freebsd.go b/common_freebsd.go index bf01f93..2aafd73 100644 --- a/common_freebsd.go +++ b/common_freebsd.go @@ -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 diff --git a/host_freebsd.go b/host_freebsd.go index b08895c..abe299b 100644 --- a/host_freebsd.go +++ b/host_freebsd.go @@ -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 } diff --git a/host_linux.go b/host_linux.go index e1e6c1f..62ebaf3 100644 --- a/host_linux.go +++ b/host_linux.go @@ -19,8 +19,7 @@ func HostInfo() (HostInfoStat, error) { return ret, nil } - -func Boot_time() (int64, error){ +func Boot_time() (int64, error) { sysinfo := &syscall.Sysinfo_t{} if err := syscall.Sysinfo(sysinfo); err != nil { return 0, err diff --git a/load_freebsd.go b/load_freebsd.go index 235896d..a8b0758 100644 --- a/load_freebsd.go +++ b/load_freebsd.go @@ -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 }