I have found the tutorial to get metrics from cgroup in https://docs.docker.com/articles/runmetrics/.
It would be great for us to get the metrics of containers from docker client. Is that possible to implement something like docker metrics $ip? I know somebody has implemented this but not in trunk.