Created
January 23, 2012 18:47
-
-
Save swalberg/1664840 to your computer and use it in GitHub Desktop.
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
require 'stalker' | |
include Stalker | |
require 'newrelic_rpm' | |
NewRelic::Agent.manual_start :app_name => 'Wave Payroll', :agent_enabled => true | |
job 'email.new_user' do |args| | |
user = User.find(args["user_id"]) | |
UserMailer.welcome_email(user).deliver | |
UserMailer.notify_admin(user).deliver | |
end | |
# Trace all the jobs as background tasks | |
# The :name is expanded at run time, hence single quotes | |
# See https://newrelic.com/docs/ruby/monitoring-ruby-background-processes-and-daemons | |
class << self | |
include NewRelic::Agent::Instrumentation::ControllerInstrumentation | |
add_transaction_tracer :job, :name => '#{args[0]}', :category => 'task' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment