Get root container stats from cAdvisor

I changed the GetContainerStats function, which will return the root container's stats if the container name is empty. This is useful when the master wants to know machine wide information. e.g. total memory usage of a certain node.
IMO, it should be a system something like this:

/stats for the machine
/stats/<podId> for a set of stats for a pod
/stats/<podid>/<containerName> for a particular container


On Wed, Jul 2, 2014 at 10:44 AM, monnand <notifications@github.com> wrote:

> In pkg/kubelet/kubelet.go:
>
> > @@ -790,17 +790,23 @@ func (kl *Kubelet) GetContainerInfo(name string) (string, error) {
> >  	return string(data), err
> >  }
> >
> > -//Returns stats (from Cadvisor) for a container
> > +// Returns stats (from Cadvisor) for a container. If name is empty, then it
> > +// returns the root container's stats.
> >  func (kl *Kubelet) GetContainerStats(name string) (*api.ContainerStats, error) {
>
> How about the rest api? Should we keep using the same path for the
> machine? Or we need to add a new path named /machineStats?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/328/files#r14471796>
> .
>