nephelae 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ module Nephelae
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get_metrics
|
13
|
-
metrics = Metrics.new('
|
13
|
+
metrics = Metrics.new('Nephelae/Linux')
|
14
14
|
output = `#{command}`
|
15
15
|
|
16
16
|
if $?.success?
|
@@ -34,10 +34,10 @@ module Nephelae
|
|
34
34
|
metrics.append_metric('SwapFree', stats[:swap_free], {unit: 'Kilobytes'})
|
35
35
|
swap_used = stats[:swap_total] - stats[:swap_free]
|
36
36
|
|
37
|
-
metrics.append_metric('SwapUsed',
|
37
|
+
metrics.append_metric('SwapUsed', swap_used, {unit: 'Kilobytes'})
|
38
38
|
|
39
39
|
unless stats[:swap_total] == 0
|
40
|
-
swap_used_percent = (
|
40
|
+
swap_used_percent = (swap_used.to_f / stats[:swap_total].to_f * 100).to_i
|
41
41
|
metrics.append_metric('SwapUsedPercentage', swap_used_percent, {unit: 'Percent'})
|
42
42
|
end
|
43
43
|
end
|
data/lib/nephelae/version.rb
CHANGED