New Relic agent is not a full profiler. It is able to trace some methods it knows are available in the many frameworks and libraries it supports.
Usually when you see an entry like that (ApplicationCode in (Nested/Controller/my_controller/my_action) it means that either it is code inside that method that is taking too long (think a long running loop) or some of your methods that the agent wouldn't know.
class MyController < ApplicationController def my_action 1000.times do # something that takes time end end def another_action Foo.new.do_something end end class Foo def do_something # something that takes time end end
In my_action you could use the Trace API to trace blocks of code.
require 'new_relic/agent/method_tracer' class MyController < ApplicationController extend ::NewRelic::Agent::MethodTracer def my_action self.class.trace_execution_scoped(['Custom/slow_action/beginning_work']) do 1000.times do # something that takes time end end end end
Or for the case that you are calling another method (like in another_action), you can use method tracers.
require 'new_relic/agent/method_tracer' class Foo def do_something # something that takes time end class << self include ::NewRelic::Agent::MethodTracer add_method_tracer :do_something, 'Custom/do_something' end end
MyController#my_actionis doing? It will be hard to determine much from what you have posted so far.