如何使用perftools和bundler来分析RSpec?
我需要分析我通常使用bundle exec rspec spec/
运行的测试套件并生成GIF图像。
运行perftools.rb以使其与bundler一起正常工作的命令是什么?
我也不得不四处寻找。 这就是我做的
-
把它放在spec_helper.rb中:
config.before :suite do PerfTools::CpuProfiler.start("/tmp/rspec_profile") end config.after :suite do PerfTools::CpuProfiler.stop end
-
运行你的rspec
-
运行pprof来获取您的号码
pprof.rb --text /tmp/rspec_profile