This commit is contained in:
albert
2013-02-17 20:13:22 -05:00
parent cb5693b1c9
commit c9a0a3b6c3
3 changed files with 9 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ gem 'rmagick', :require => "RMagick"
gem 'daemons'
gem 'net-ssh'
gem 'net-sftp'
gem 'sys-proctable', :require => "sys/proctable"
group :development do
gem 'newrelic_rpm'

View File

@@ -159,6 +159,7 @@ GEM
super_exception_notifier (3.0.13)
actionmailer
rake
sys-proctable (0.9.2)
therubyracer (0.11.3)
libv8 (~> 3.11.8.12)
ref
@@ -207,6 +208,7 @@ DEPENDENCIES
simple_form
simplecov
super_exception_notifier
sys-proctable
therubyracer
uglifier (>= 1.0.3)
whenever

View File

@@ -4,6 +4,11 @@ module Memorylogic
end
def self.memory_usage
number_to_human_size(`ps -o rss= -p #{Process.pid}`.to_i * 1.kilobyte)
ps = Sys::ProcTable.ps(Process.pid)
if ps.respond_to?(:rss)
number_to_human_size(ps.rss.to_i * 1.kilobyte)
else
0
end
end
end