Class: Docker::Container
- Inherits:
-
Object
- Object
- Docker::Container
- Defined in:
- lib/support/docker_api.rb
Instance Method Summary collapse
-
#stats(options = {}) ⇒ Object
Non streaming stats.
Instance Method Details
#stats(options = {}) ⇒ Object
Non streaming stats
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/support/docker_api.rb', line 8 def stats( = {}) path = path_for(:stats) puts "Getting stats from: #{path}" [:stream] = false container_stats = nil begin status = Timeout::timeout(5) { container_stats = connection.get(path, ) } rescue Exception => e return {error: e.} end JSON.parse(container_stats) end |