stackprof 0.2.10 → 0.2.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +43 -0
- data/.gitignore +2 -0
- data/CHANGELOG.md +18 -0
- data/README.md +87 -67
- data/Rakefile +21 -25
- data/bin/stackprof +115 -70
- data/ext/stackprof/extconf.rb +6 -0
- data/ext/stackprof/stackprof.c +434 -37
- data/lib/stackprof/autorun.rb +19 -0
- data/lib/stackprof/flamegraph/flamegraph.js +926 -300
- data/lib/stackprof/flamegraph/viewer.html +29 -23
- data/lib/stackprof/middleware.rb +23 -7
- data/lib/stackprof/report.rb +323 -18
- data/lib/stackprof/truffleruby.rb +37 -0
- data/lib/stackprof.rb +18 -1
- data/sample.rb +3 -3
- data/stackprof.gemspec +11 -2
- data/test/fixtures/profile.dump +1 -0
- data/test/fixtures/profile.json +1 -0
- data/test/test_middleware.rb +13 -7
- data/test/test_report.rb +24 -0
- data/test/test_stackprof.rb +177 -25
- data/test/test_truffleruby.rb +18 -0
- data/vendor/FlameGraph/flamegraph.pl +751 -85
- metadata +17 -10
- data/.travis.yml +0 -8
- data/Gemfile.lock +0 -24
@@ -0,0 +1,19 @@
|
|
1
|
+
require "stackprof"
|
2
|
+
|
3
|
+
options = {}
|
4
|
+
options[:mode] = ENV["STACKPROF_MODE"].to_sym if ENV.key?("STACKPROF_MODE")
|
5
|
+
options[:interval] = Integer(ENV["STACKPROF_INTERVAL"]) if ENV.key?("STACKPROF_INTERVAL")
|
6
|
+
options[:raw] = true if ENV["STACKPROF_RAW"]
|
7
|
+
options[:ignore_gc] = true if ENV["STACKPROF_IGNORE_GC"]
|
8
|
+
|
9
|
+
at_exit do
|
10
|
+
StackProf.stop
|
11
|
+
output_path = ENV.fetch("STACKPROF_OUT") do
|
12
|
+
require "tempfile"
|
13
|
+
Tempfile.create(["stackprof", ".dump"]).path
|
14
|
+
end
|
15
|
+
StackProf.results(output_path)
|
16
|
+
$stderr.puts("StackProf results dumped at: #{output_path}")
|
17
|
+
end
|
18
|
+
|
19
|
+
StackProf.start(**options)
|