Sha256: 0e1f59a8506e082318269f33f5d962482467b10d1a5535c09725c42fa930d7fc

Contents?: true

Size: 582 Bytes

Versions: 5

Compression:

Stored size: 582 Bytes

Contents

require "stackprof"

options = {}
options[:mode] = ENV["STACKPROF_MODE"].to_sym if ENV.key?("STACKPROF_MODE")
options[:interval] = Integer(ENV["STACKPROF_INTERVAL"]) if ENV.key?("STACKPROF_INTERVAL")
options[:raw] = true if ENV["STACKPROF_RAW"]
options[:ignore_gc] = true if ENV["STACKPROF_IGNORE_GC"]

at_exit do
  StackProf.stop
  output_path = ENV.fetch("STACKPROF_OUT") do
    require "tempfile"
    Tempfile.create(["stackprof", ".dump"]).path
  end
  StackProf.results(output_path)
  $stderr.puts("StackProf results dumped at: #{output_path}")
end

StackProf.start(**options)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stackprof-0.2.26 lib/stackprof/autorun.rb
stackprof-0.2.25 lib/stackprof/autorun.rb
stackprof-0.2.24 lib/stackprof/autorun.rb
stackprof-0.2.23 lib/stackprof/autorun.rb
stackprof-0.2.22 lib/stackprof/autorun.rb