Fix memory value in stats api

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-02-11 15:55:19 -08:00
parent 34024a5dbc
commit d2bf71043f
2 changed files with 2 additions and 2 deletions

View file

@ -183,7 +183,7 @@ func (s *apiServer) State(ctx context.Context, r *types.StateRequest) (*types.St
state := &types.StateResponse{ state := &types.StateResponse{
Machine: &types.Machine{ Machine: &types.Machine{
Cpus: uint32(m.Cpus), Cpus: uint32(m.Cpus),
Memory: uint64(m.Cpus), Memory: uint64(m.Memory),
}, },
} }
for _, c := range e.Containers { for _, c := range e.Containers {

View file

@ -18,6 +18,6 @@ func CollectMachineInformation() (Machine, error) {
if err := mem.Get(); err != nil { if err := mem.Get(); err != nil {
return m, err return m, err
} }
m.Memory = int64(mem.Total) m.Memory = int64(mem.Total / 1024 / 1024)
return m, nil return m, nil
} }