Sha256: 431aa3992e003e8edadcd09ac7c58614bb64e90811182f99cf7f975e47292772

Contents?: true

Size: 705 Bytes

Versions: 141

Compression:

Stored size: 705 Bytes

Contents

#!/usr/bin/env ruby

require 'bundler/setup'
require 'hamlit'
require 'stackprof'

def open_flamegraph(report)
  temp = `mktemp /tmp/stackflame-XXXXXXXX`.strip
  data_path = "#{temp}.js"
  system("mv #{temp} #{data_path}")

  File.open(data_path, 'w') do |f|
    report.print_flamegraph(f)
  end

  viewer_path = File.join(`bundle show stackprof`.strip, 'lib/stackprof/flamegraph/viewer.html')
  url = "file://#{viewer_path}?data=#{data_path}"
  system(%Q[osascript -e 'open location "#{url}"'])
end

haml = File.read(ARGV.first)
StackProf.start(mode: :wall, interval: 1, raw: false)
Hamlit::Engine.new.call(haml)
StackProf.stop

report = StackProf::Report.new(StackProf.results)
report.print_text(false)

Version data entries

141 entries across 141 versions & 2 rubygems

Version Path
haml-6.3.0 bin/stackprof
haml-6.2.5 bin/stackprof
haml-6.2.4 bin/stackprof
haml-6.2.3 bin/stackprof
haml-6.2.2 bin/stackprof
haml-6.2.1 bin/stackprof
haml-6.2.0 bin/stackprof
haml-6.1.4-java bin/stackprof
haml-6.1.4 bin/stackprof
haml-6.1.3-java bin/stackprof
haml-6.1.3 bin/stackprof
haml-6.1.2-java bin/stackprof
haml-6.1.2 bin/stackprof
haml-6.1.1-java bin/stackprof
haml-6.1.1 bin/stackprof
haml-6.1.0-java bin/stackprof
haml-6.1.0 bin/stackprof
haml-6.0.12-java bin/stackprof
haml-6.0.12 bin/stackprof
haml-6.0.11-java bin/stackprof