forget to commit procs in HostInfo.

This commit is contained in:
WAKAYAMA Shirou 2014-04-19 01:05:35 +09:00
parent ab22e78f2d
commit 8145c0cef0
1 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@
package main package main
import ( import (
"github.com/mitchellh/go-ps"
"os" "os"
"syscall" "syscall"
) )
@ -26,5 +27,13 @@ func (h Host) HostInfo() (HostInfo, error) {
uptimemsec, _, err := syscall.Syscall(uintptr(GetTickCount), 0, 0, 0, 0) uptimemsec, _, err := syscall.Syscall(uintptr(GetTickCount), 0, 0, 0, 0)
ret.Uptime = int64(uptimemsec) / 1000 ret.Uptime = int64(uptimemsec) / 1000
procs, err := ps.Processes()
if err != nil {
return ret, err
}
ret.Procs = uint64(len(procs))
return ret, nil return ret, nil
} }