class Docker::Container

Public Instance Methods

stats(options = {}) click to toggle source

Non streaming stats

# File lib/support/docker_api.rb, line 8
def stats(options = {})
  path = path_for(:stats)
  puts "Getting stats from: #{path}"
  options[:stream] = false
  container_stats = nil
  begin
    status = Timeout::timeout(5) {
      container_stats = connection.get(path, options)
    }
  rescue Exception => e
    return {error: e.message}
  end
  JSON.parse(container_stats)
end