heartbeat-client 0.4.1 → 0.4.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.
- data/VERSION +1 -1
- data/lib/heartbeat-client.rb +22 -19
- metadata +3 -3
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.2
|
data/lib/heartbeat-client.rb
CHANGED
|
@@ -109,11 +109,11 @@ class Heartbeat
|
|
|
109
109
|
|
|
110
110
|
if File.exists?('/tmp/mongodb.out')
|
|
111
111
|
File.open("/tmp/mongodb.out", "r") do |infile|
|
|
112
|
-
counter = 0
|
|
112
|
+
counter = 0; lines = []
|
|
113
113
|
while (line = infile.gets)
|
|
114
|
-
|
|
115
|
-
counter += 1
|
|
114
|
+
lines << line
|
|
116
115
|
end
|
|
116
|
+
mongodb_status(mongodb, lines)
|
|
117
117
|
end
|
|
118
118
|
end
|
|
119
119
|
|
|
@@ -221,22 +221,25 @@ class Heartbeat
|
|
|
221
221
|
end
|
|
222
222
|
end
|
|
223
223
|
|
|
224
|
-
def self.mongodb_status(mongodb,
|
|
225
|
-
if
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
224
|
+
def self.mongodb_status(mongodb, lines)
|
|
225
|
+
if lines and lines.size == 3
|
|
226
|
+
header = lines[1].gsub('%', '').gsub('miss', '').split(' '); mo = lines[2].split(' ')
|
|
227
|
+
if header and mo and header.size == mo.size
|
|
228
|
+
header.each_with_index do |h, index|
|
|
229
|
+
mongodb['insert'] = mo[index].strip.to_i if h == 'insert'
|
|
230
|
+
mongodb['query'] = mo[index].to_i if h == 'query'
|
|
231
|
+
mongodb['update'] = mo[index].strip.to_i if h == 'update'
|
|
232
|
+
mongodb['delete'] = mo[index].strip.to_i if h == 'delete'
|
|
233
|
+
mongodb['getmore'] = mo[index].strip.to_i if h == 'getmore'
|
|
234
|
+
mongodb['command'] = mo[index].strip.to_i if h == 'command'
|
|
235
|
+
mongodb['flushes'] = mo[index].strip.to_i if h == 'flushes'
|
|
236
|
+
mongodb['mapped'] = mo[index].strip if h == 'mapped'
|
|
237
|
+
mongodb['vsize'] = mo[index].strip if h == 'vsize'
|
|
238
|
+
mongodb['res'] = mo[index].strip if h == 'res'
|
|
239
|
+
mongodb['netIn'] = mo[index].strip if h == 'netIn'
|
|
240
|
+
mongodb['netOut'] = mo[index].strip if h == 'netOut'
|
|
241
|
+
mongodb['conn'] = mo[index].strip if h == 'conn'
|
|
242
|
+
end
|
|
240
243
|
end
|
|
241
244
|
end
|
|
242
245
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: heartbeat-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 11
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 4
|
|
9
|
-
-
|
|
10
|
-
version: 0.4.
|
|
9
|
+
- 2
|
|
10
|
+
version: 0.4.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Oliver Kiessler
|