Sha256: 6f015ea584d44a5366b8cf906dcc4e8facd23f155ac5d92c9100836d760794c8
Contents?: true
Size: 984 Bytes
Versions: 11
Compression:
Stored size: 984 Bytes
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 def self.setup require 'tmpdir' require 'stackprof' end def before(test, test_name) StackProf.start(:mode => :wall) 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 end end
Version data entries
11 entries across 11 versions & 1 rubygems