522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
|
# File 'lib/new_relic/agent/transaction.rb', line 522
def finish
return unless state.is_execution_traced? && initial_segment
@end_time = Process.clock_gettime(Process::CLOCK_REALTIME)
@duration = @end_time - @start_time
freeze_name_and_execute_if_not_ignored
if nesting_max_depth == 1
initial_segment.name = @frozen_name
end
initial_segment.transaction_name = @frozen_name
assign_segment_dt_attributes
assign_agent_attributes
initial_segment.finish
NewRelic::Agent::TransactionTimeAggregator.transaction_stop(@end_time, @starting_thread_id)
commit!(initial_segment.name) unless @ignore_this_transaction
rescue => e
NewRelic::Agent.logger.error('Exception during Transaction#finish', e)
nil
ensure
state.reset
end
|