class Rake::Task

Public Instance Methods

invoke(*args) click to toggle source
# File lib/new_relic/agent/instrumentation/rake.rb, line 25
def invoke(*args)
  unless NewRelic::Agent::Instrumentation::RakeInstrumentation.should_trace? name
    return invoke_without_newrelic(*args)
  end

  begin
    timeout = NewRelic::Agent.config[:'rake.connect_timeout']
    NewRelic::Agent.instance.wait_on_connect(timeout)
  rescue => e
    NewRelic::Agent.logger.error("Exception in wait_on_connect", e)
    return invoke_without_newrelic(*args)
  end

  NewRelic::Agent::Instrumentation::RakeInstrumentation.before_invoke_transaction(self)

  state = NewRelic::Agent::TransactionState.tl_get
  NewRelic::Agent::Transaction.wrap(state, "OtherTransaction/Rake/invoke/#{name}", :rake)  do
    NewRelic::Agent::Instrumentation::RakeInstrumentation.record_attributes(args, self)
    invoke_without_newrelic(*args)
  end
end
Also aliased as: invoke_without_newrelic
invoke_without_newrelic(*args)
Alias for: invoke