use gem
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user