Sha256: c574709ab834bb82c5ad37015e371e5cd5c785dcfc863d801c3c1a7b6deee908

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

Stored size: 1.11 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
  module Instrumentation
    class StackProfProfile < Instrumentor
      platforms :mri_21, :mri_22

      def self.setup
        require 'tmpdir'
        require 'stackprof'
      end

      def mode
        :wall
      end

      def before(test, test_name)
        StackProf.start(:mode => mode)
      end

      def after(test, test_name)
        StackProf.stop

        output_dump_path = artifact_path(test, test_name, "dump")
        StackProf.results(output_dump_path)
        @artifacts << output_dump_path

        results = Marshal.load(File.read(output_dump_path))
        output_dot_path = artifact_path(test, test_name, "dot")
        report = StackProf::Report.new(results)
        File.open(output_dot_path, "w") do |f|
          report.print_graphviz(nil, f)
        end
        @artifacts << output_dot_path
      end
    end

    class StackProfAllocationProfile < StackProfProfile
      def mode
        :object
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
newrelic_rpm-3.16.2.321 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.16.1.320 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.16.0.318 test/performance/lib/performance/instrumentation/stackprof.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.15.2.317 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.15.1.316 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.15.0.314 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.14.3.313 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.14.2.312 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.14.1.311 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.14.0.305 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.13.2.302 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.13.1.300 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.13.0.299 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.12.1.298 test/performance/lib/performance/instrumentation/stackprof.rb
newrelic_rpm-3.12.0.288 test/performance/lib/performance/instrumentation/stackprof.rb