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.
- checksums.yaml +4 -4
- data/bin/riemann-docker +27 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66358a5e216149db37da3ea6d8ade076d552d0f2
|
4
|
+
data.tar.gz: ec11d6f19824ee317d095f88729e6183ac0c94a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
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.
|
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-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riemann-tools
|