lib/riemann/babbler/plugins/memory.rb in riemann-babbler-0.7.8 vs lib/riemann/babbler/plugins/memory.rb in riemann-babbler-0.7.9
- old
+ new
@@ -17,11 +17,11 @@
swap_fraction = m['SwapTotal'] == 0 ? 0 : 1 - m['SwapFree'].to_f/m['SwapTotal']
desc = "usage\n\n#{shell('ps -eo pmem,pid,cmd | sort -nrb -k1 | head -10').chomp}"
[
- { :service => plugin.service + " % free", :metric => fraction },
- { :service => plugin.service + " % swap", :metric => swap_fraction },
+ { :service => plugin.service + " % free", :metric => fraction.round(2) * 100 },
+ { :service => plugin.service + " % swap", :metric => swap_fraction.round(2) * 100 },
{ :service => plugin.service + " abs free", :metric => free, :state => 'ok', :description => desc },
{ :service => plugin.service + " abs total", :metric => total, :state => 'ok', :description => desc },
{ :service => plugin.service + " abs cached", :metric => cached, :state => 'ok', :description => desc },
{ :service => plugin.service + " abs buffers", :metric => buffers, :state => 'ok', :description => desc },
{ :service => plugin.service + " abs used", :metric => used , :state => 'ok', :description => desc },