Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created October 17, 2013 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myronmarston/7029573 to your computer and use it in GitHub Desktop.
Save myronmarston/7029573 to your computer and use it in GitHub Desktop.
GC signal for Qless
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