nephelae 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nephelae/plugins/mem_usage.rb +3 -1
- data/lib/nephelae/plugins/redis.rb +10 -4
- data/lib/nephelae/version.rb +1 -1
- metadata +1 -1
@@ -15,7 +15,9 @@ module Nephelae
|
|
15
15
|
|
16
16
|
if $?.success?
|
17
17
|
stats = parse_status(output)
|
18
|
-
|
18
|
+
|
19
|
+
mem_total = stats[:mem_total]
|
20
|
+
metrics.append_metric('MemoryTotal', mem_total, {unit: 'Kilobytes'})
|
19
21
|
|
20
22
|
mem_free = stats[:mem_free] + stats[:buffers] + stats[:cached]
|
21
23
|
metrics.append_metric('MemoryFree', mem_free, {unit: 'Kilobytes'})
|
@@ -16,8 +16,8 @@ module Nephelae
|
|
16
16
|
if $?.success?
|
17
17
|
stats = parse_status(output)
|
18
18
|
metrics.append_metric('Up', 1)
|
19
|
-
metrics.append_metric('MasterLinkStatus', (stats[:master] == 'up' ? 1 : 0))
|
20
|
-
metrics.append_metric('MasterIOSecondsAgo', stats[:master_last_io_seconds_ago], {unit: 'Seconds'})
|
19
|
+
metrics.append_metric('MasterLinkStatus', (stats[:master] == 'up' ? 1 : 0)) unless stats[:master].nil?
|
20
|
+
metrics.append_metric('MasterIOSecondsAgo', stats[:master_last_io_seconds_ago], {unit: 'Seconds'}) unless stats[:master_last_io_seconds_ago].nil?
|
21
21
|
metrics.append_metric('ChangesSinceLastSave', stats[:changes_since_last_save], {unit: 'Count'})
|
22
22
|
metrics.append_metric('UsedMemory', stats[:used_memory], {unit: 'Bytes'})
|
23
23
|
metrics.append_metric('ConnectedSlaves', stats[:connected_slaves], {unit: 'Count'})
|
@@ -32,8 +32,14 @@ module Nephelae
|
|
32
32
|
|
33
33
|
private
|
34
34
|
def parse_status(body)
|
35
|
-
|
36
|
-
|
35
|
+
ret = {}
|
36
|
+
mls = body.match(/master_link_status:(\w+)/)
|
37
|
+
ret[:master_link_status] = mls.nil? ? "down" : mls[1]
|
38
|
+
|
39
|
+
mlio = body.match(/master_last_io_seconds_ago:(\d+)/)
|
40
|
+
ret[:master_last_io_seconds_ago] = mlio[1] unless mlio.nil?
|
41
|
+
|
42
|
+
ret.merge {
|
37
43
|
:changes_since_last_save => body.match(/changes_since_last_save:(\d+)/)[1],
|
38
44
|
:used_memory => body.match(/used_memory:(\d+)/)[1],
|
39
45
|
:connected_slaves => body.match(/connected_slaves:(\d+)/)[1],
|
data/lib/nephelae/version.rb
CHANGED