Adds docker metrics plugin

Originally made by @mikz
Agree. I could've done that. It would look better.

Sent from my iPhone

> On 5. 8. 2014, at 23:03, Artem Chernikov <notifications@github.com> wrote:
> 
> In plugins/docker/docker-container-metrics.rb:
> 
> > +
> > +  def container_metrics
> > +    cgroup = Pathname(config[:cgroup_path]).join('cpu/docker')
> > +
> > +    timestamp = Time.now.to_i
> > +    ps = Sys::ProcTable.ps.group_by(&:pid)
> > +    sleep(1)
> > +    ps2 = Sys::ProcTable.ps.group_by(&:pid)
> > +
> > +    fields = [:rss, :vsize, :nswap, :pctmem]
> > +
> > +    ENV['DOCKER_HOST'] = config[:docker_host]
> > +    containers = `docker ps --quiet --no-trunc`.split("\n")
> > +
> > +    containers.each do |container|
> > +      pids = cgroup.join(container).join('cgroup.procs').read.split("\n").map(&:to_i)
> @rhoml i think generally you can use readlines from ruby std lib. Which will do exactly the same
> 
> —
> Reply to this email directly or view it on GitHub.