Making it not crash on Windows
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
b413f33b99
commit
3d8e37cf9d
8 changed files with 146 additions and 101 deletions
18
supervisor/machine_linux.go
Normal file
18
supervisor/machine_linux.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package supervisor
|
||||
|
||||
import "github.com/cloudfoundry/gosigar"
|
||||
|
||||
func CollectMachineInformation() (Machine, error) {
|
||||
m := Machine{}
|
||||
cpu := sigar.CpuList{}
|
||||
if err := cpu.Get(); err != nil {
|
||||
return m, err
|
||||
}
|
||||
m.Cpus = len(cpu.List)
|
||||
mem := sigar.Mem{}
|
||||
if err := mem.Get(); err != nil {
|
||||
return m, err
|
||||
}
|
||||
m.Memory = int64(mem.Total / 1024 / 1024)
|
||||
return m, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue