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