# encoding: utf-8 require 'one_apm/transaction/transaction_sample' require 'one_apm/transaction/segment' require 'one_apm/transaction/summary_segment' module OneApm class TransactionSample class CompositeSegment < Segment attr_reader :detail_segments def initialize(segments) summary = SummarySegment.new(segments.first) super summary.entry_timestamp, "Repeating pattern (#{segments.length} repeats)" summary.end_trace(segments.last.exit_timestamp) @detail_segments = segments.clone add_called_segment(summary) end_trace summary.exit_timestamp end def detail_segments=(segments) @detail_segments = segments end end end end