Class: NewRelic::TransactionSample::CompositeSegment

Inherits:
Segment show all
Defined in:
lib/new_relic/transaction_sample.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=, #duration, #each_segment, #end_trace, #exclusive_duration, #explain_sql, #find_segment, #freeze, from_json, #handle_exception_in_explain, #obfuscated_sql, #params, #path_string, #to_debug_str, #to_json, #to_s, #to_s_compact

Constructor Details

#initialize(segments) ⇒ CompositeSegment

Returns a new instance of CompositeSegment.



273
274
275
276
277
278
279
280
281
282
283
# File 'lib/new_relic/transaction_sample.rb', line 273

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.



271
272
273
# File 'lib/new_relic/transaction_sample.rb', line 271

def detail_segments
  @detail_segments
end