Module: Lrama::Report::Profile
- Defined in:
- lib/lrama/report.rb
Class Method Summary collapse
Class Method Details
.report_profile ⇒ Object
-
Wrap target method with Profile.report_profile like below:
Lrama::Report::Profile.report_profile { method }
-
Run lrama command, for example
$ ./exe/lrama --trace=time spec/fixtures/integration/ruby_3_2_0/parse.tmp.y
-
Generate html file
$ stackprof --d3-flamegraph tmp/stackprof-cpu-myapp.dump > tmp/flamegraph.html
16 17 18 19 20 21 22 |
# File 'lib/lrama/report.rb', line 16 def self.report_profile require "stackprof" StackProf.run(mode: :cpu, raw: true, out: 'tmp/stackprof-cpu-myapp.dump') do yield end end |