Making it not crash on Windows
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
		| @@ -1,23 +1,6 @@ | ||||
| package supervisor | ||||
|  | ||||
| import "github.com/cloudfoundry/gosigar" | ||||
|  | ||||
| type Machine struct { | ||||
| 	Cpus   int | ||||
| 	Memory int64 | ||||
| } | ||||
|  | ||||
| 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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 John Howard
					John Howard