Libcontainer outputs stats as floats so we may have to do that for now.
That's fine by me
On May 21, 2014 5:24 PM, "Evan Hazlett" <notifications@github.com> wrote:

> In api/client/commands.go:
>
> > +
> > +	if err != nil {
> > +		return err
> > +	}
> > +	outs := engine.NewTable("stats", 0)
> > +	if _, err := outs.ReadListFrom(body); err != nil {
> > +		return err
> > +	}
> > +	w := tabwriter.NewWriter(cli.out, 5, 6, 6, ' ', 0)
> > +	fmt.Fprintf(w, "CPU\tRSS\tCACHE\tACTIVE FILE\tUSAGE IN BYTES\n")
> > +	if len(outs.Data) != 2 {
> > +		return fmt.Errorf("Invalid stat data, please check logs")
> > +	}
> > +	cpu := outs.Data[0].GetSubEnv("Stats")
> > +	mem := outs.Data[1].GetSubEnv("Stats")
> > +	fmt.Fprintf(w, "%d\t%d\t%d\t%d\t%d\t\n", cpu.GetInt("percentage"), mem.GetInt("total_rss"), mem.GetInt("total_cache"), mem.GetInt("total_active_file"), mem.GetInt("usage_in_bytes"))
>
> Ok so I think I just misunderstood. Sorry. I will dig into converting to
> ints and doing the conversion to cores, etc. at the user side.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dotcloud/docker/pull/5424/files#r12930354>
> .
>