Change /containers to /state with machine info

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2015-12-03 11:49:56 -08:00
parent 3ea5dd79e0
commit c1eb9ac90b
5 changed files with 56 additions and 10 deletions

23
machine.go Normal file
View File

@@ -0,0 +1,23 @@
package containerd
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)
return m, nil
}