我需要分析通常使用 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
关于ruby-on-rails - 如何使用 perftools 和 bundler 分析 RSpec?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9680481/