Created
October 17, 2013 18:11
-
-
Save myronmarston/7029573 to your computer and use it in GitHub Desktop.
GC signal for Qless
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trap('USR1') do | |
before_status = File.read("/proc/#{Process.pid}/status") | |
before_time = Time.now | |
GC.start | |
after_time = Time.now | |
duration_in_ms = ((after_time - before_time) * 1000).to_i | |
after_status = File.read("/proc/#{Process.pid}/status") | |
log(:error, "Ran GC. Took #{duration_in_ms} ms. Before proc status: #{before_status}. After proc status: #{after_status}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment