Sha256: bad65bff768e3a05871988b4472910ad030d240dd844055f0ab108a0deae0db8

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

module Performance
  class ConsoleReporter
    include Reporting

    def initialize(results, elapsed, options={})
      @results = results
      @elapsed = elapsed
      @options = options
    end

    def report
      report_summary
      report_successful_results(successes) unless successes.empty?
      report_failed_results
    end

    def report_successful_results(results)
      return if successes.empty?

      puts ''
      results.each do |result|
        puts "#{result.identifier}: #{result.elapsed} s"
        unless @options[:brief]
          result.measurements.each do |key, value|
            puts "  %s: %g" % [key, value]
          end
        end
        unless result.artifacts.empty?
          puts "  artifacts:"
          result.artifacts.each do |artifact|
            puts "    #{artifact}"
          end
        end
        puts '' if !@options[:brief] || !result.artifacts.empty?
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-3.10.0.279 test/performance/lib/performance/console_reporter.rb
newrelic_rpm-3.9.9.275 test/performance/lib/performance/console_reporter.rb
newrelic_rpm-3.9.8.273 test/performance/lib/performance/console_reporter.rb
newrelic_rpm-3.9.7.266 test/performance/lib/performance/console_reporter.rb
newrelic_rpm-3.9.6.257 test/performance/lib/performance/console_reporter.rb
newrelic_rpm-3.9.5.251 test/performance/lib/performance/console_reporter.rb
newrelic_rpm-3.9.4.245 test/performance/lib/performance/console_reporter.rb