Class: NewRelic::TransactionSample::CompositeSegment

Inherits:
Segment
  • Object
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=, #count_segments, #duration, #each_segment, #end_trace, #exclusive_duration, #explain_sql, #find_segment, #handle_exception_in_explain, #obfuscated_sql, #params, #params=, #path_string, #to_debug_str, #to_json, #to_s, #to_s_compact, #truncate

Constructor Details

#initialize(segments) ⇒ CompositeSegment

Returns a new instance of CompositeSegment.



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

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.



273
274
275
# File 'lib/new_relic/transaction_sample.rb', line 273

def detail_segments
  @detail_segments
end