Comment profiler RSpec avec perftools et bundler ?
-
13-12-2019 - |
Question
Je dois profiler la suite de tests avec laquelle j'exécute habituellement bundle exec rspec spec/
et produisez l’image GIF.
Quelle est la commande pour exécuter le perftools.rb pour que ça fonctionne correctement avec bundler ?
La solution
Moi aussi, j'ai dû fouiller pour obtenir ça.Voici ce que j'ai fait
Mettez ceci dans spec_helper.rb :
config.before :suite do PerfTools::CpuProfiler.start("/tmp/rspec_profile") end config.after :suite do PerfTools::CpuProfiler.stop end
Exécutez votre rspec
Exécutez pprof pour obtenir vos numéros
pprof.rb --text /tmp/rspec_profile
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow