metricsets_summary

in spec/support/event_collector.rb [146:168]


  def metricsets_summary
    metricsets.each_with_object(
      Hash.new { 0 }
    ) do |set, totals|
      next unless set['transaction']

      count = set['samples']['span.self_time.count']

      case set.dig('span', 'type')
      when 'app'
        subtype = set.dig('span', 'subtype')
        key = :"app_span_self_times__#{subtype || 'nil'}"
        next totals && totals[key] += count['value']
      when 'template'
        totals && totals[:template_span_self_times] += count['value']
        next
      else
        pp set
        raise 'Unmatched metric type'
      end
    end
  end