Class: NewRelic::TransactionSample::CompositeSegment

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

Instance Attribute Summary collapse

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(segments) ⇒ CompositeSegment

Returns a new instance of CompositeSegment.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/new_relic/transaction_sample/composite_segment.rb', line 9

def initialize(segments)
  summary = SummarySegment.new(segments.first)
  super summary., "Repeating pattern (#{segments.length} repeats)", nil

  summary.end_trace(segments.last.exit_timestamp)

  @detail_segments = segments.clone

  add_called_segment(summary)
  end_trace summary.exit_timestamp
end

Instance Attribute Details

#detail_segmentsObject

Returns the value of attribute detail_segments.



7
8
9
# File 'lib/new_relic/transaction_sample/composite_segment.rb', line 7

def detail_segments
  @detail_segments
end