# File lib/new_relic/agent/busy_calculator.rb, line 40 def dispatcher_finish(end_time = nil) #THREAD_LOCAL_ACCESS state = TransactionState.tl_get # If #dispatcher_start hasn't been called at least once, abort early return unless state.busy_entries end_time ||= time_now callers = state.busy_entries -= 1 # Ignore nested calls return if callers > 0 @lock.synchronize do if @entrypoint_stack.empty? ::NewRelic::Agent.logger.warn("Stack underflow tracking dispatcher entry and exit!\n #{caller.join(" \n")}") else @accumulator += (end_time - @entrypoint_stack.pop).to_f end end end