Class: NewRelic::TransactionSample::SummarySegment

Inherits:
Segment show all
Defined in:
lib/new_relic/transaction_sample.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=, #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(segment) ⇒ SummarySegment

Returns a new instance of SummarySegment.



254
255
256
257
258
259
260
# File 'lib/new_relic/transaction_sample.rb', line 254

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



262
263
264
265
266
# File 'lib/new_relic/transaction_sample.rb', line 262

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