Class: NewRelic::TransactionSample::SummarySegment

Inherits:
Segment
  • Object
show all
Defined in:
lib/new_relic/transaction_sample/summary_segment.rb

Instance Attribute Summary

Attributes inherited from Segment

#entry_timestamp, #exit_timestamp, #metric_name, #parent_segment, #segment_id

Instance Method Summary collapse

Methods inherited from Segment

#[], #[]=, #add_called_segment, #called_segments, #called_segments=, #count_segments, #duration, #each_segment, #each_segment_with_nest_tracking, #end_trace, #exclusive_duration, #explain_sql, #find_segment, #obfuscated_sql, #params, #params=, #path_string, #to_array, #to_debug_str, #to_json, #to_s, #to_s_compact, #truncate, #truncate_each_child

Constructor Details

#initialize(segment) ⇒ SummarySegment

Returns a new instance of SummarySegment.



6
7
8
9
10
11
12
# File 'lib/new_relic/transaction_sample/summary_segment.rb', line 6

def initialize(segment)
  super segment., segment.metric_name, nil

  add_segments segment.called_segments

  end_trace segment.exit_timestamp
end

Instance Method Details

#add_segments(segments) ⇒ Object



14
15
16
17
18
# File 'lib/new_relic/transaction_sample/summary_segment.rb', line 14

def add_segments(segments)
  segments.collect do |segment|
    SummarySegment.new(segment)
  end.each {|segment| add_called_segment(segment)}
end