riemann-docker 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/riemann-docker +27 -16
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0af0b12bb7b65d32a63607a8d2821d7083994e04
4
- data.tar.gz: 2151ccd4a214ddce92b30daceff9e53a5bc538db
3
+ metadata.gz: 66358a5e216149db37da3ea6d8ade076d552d0f2
4
+ data.tar.gz: ec11d6f19824ee317d095f88729e6183ac0c94a5
5
5
  SHA512:
6
- metadata.gz: 3390eb25a55fb4bf4d641c7d586570a4121c54799769d27e5f7c08aad154c31db83efa4ff30dd7a58aec7063cc41ae0ededd1fe4851cd4b414ac2a0b8f4a0615
7
- data.tar.gz: 532dec660261dc0fde8b9ce001df480b8bac740bccbe4bfe769aa06a0b811e90c8620d9f5bd5a766c02addeabbc49f510ceb145363d2fa84398905583ff8a01a
6
+ metadata.gz: 0d5bb657f4a7d4fe9e1815c544ad7635993978b8dc0eca38c55c5bff3ca83efe1e81d898a3c10005b382b9dd9867c971dc9c3804bdfd6295620289171175aff1
7
+ data.tar.gz: d8f06dc2022edbb7cf40b2c81d1414c45922f51484ab7f53a4e51bf879d810b65b3878d14fdb4b95e316d256b72bf94b9ae135b2a48ed855bd360bbfd2e05acf
data/bin/riemann-docker CHANGED
@@ -179,25 +179,36 @@ class Riemann::Tools::DockerHealth
179
179
 
180
180
  # Get CPU, Memory and Load of each container
181
181
  containers = get_containers()
182
- containers.each do |container|
183
-
184
- id = container.id
185
- name = get_container_name(container)
186
-
187
- stats = Docker::Util.parse_json(container.connection.get("/containers/#{id}/stats", {stream:false}))
188
-
189
- if @basic_inspection_enabled
190
- inspection = Docker::Util.parse_json(container.connection.get("/containers/#{id}/json"))
191
- basic_inspection(id, name, inspection)
192
- end
193
- if @cpu_enabled
194
- cpu(id, name, stats)
195
- end
196
- if @memory_enabled
197
- memory(id, name, stats)
182
+ threads = []
183
+
184
+ containers.each do |ctr|
185
+ threads << Thread.new(ctr) do |container|
186
+
187
+ id = container.id
188
+ name = get_container_name(container)
189
+
190
+ stats = Docker::Util.parse_json(container.connection.get("/containers/#{id}/stats", {stream:false}))
191
+
192
+ if @basic_inspection_enabled
193
+ inspection = Docker::Util.parse_json(container.connection.get("/containers/#{id}/json"))
194
+ basic_inspection(id, name, inspection)
195
+ end
196
+ if @cpu_enabled
197
+ cpu(id, name, stats)
198
+ end
199
+ if @memory_enabled
200
+ memory(id, name, stats)
201
+ end
198
202
  end
199
203
  end
200
204
 
205
+ threads.each do |thread|
206
+ begin
207
+ thread.join
208
+ rescue => e
209
+ $stderr.puts "#{e.class} #{e}\n#{e.backtrace.join "\n"}"
210
+ end
211
+ end
201
212
  end
202
213
  end
203
214
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shani Elharrar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riemann-tools