Skip to content

Instantly share code, notes, and snippets.

@eric
Created October 27, 2009 05:44
Show Gist options
  • Select an option

  • Save eric/219346 to your computer and use it in GitHub Desktop.

Select an option

Save eric/219346 to your computer and use it in GitHub Desktop.
WATCHERS = 10
# Make sure pid directories exists
FileUtils.mkdir_p '/tmp/profiler-pids'
God.pid_file_directory = '/tmp/profiler-pids'
God::Logger.syslog = false
WATCHERS.times do |i|
God.watch do |w|
w.name = "watched-#{i}"
w.interval = 0
w.start = "vmstat 10 6"
w.behavior(:clean_pid_file)
w.start_if do |start|
start.condition(:process_running) do |c|
c.interval = 0
c.running = false
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment