zombocom / derailed_benchmarks

Go faster, off the Rails - Benchmarks for your whole Rails app
2.96k stars 144 forks source link

How to run derailed in a Rake Task or a Test #125

Closed blanchma closed 4 years ago

blanchma commented 5 years ago

I'm trying to test cpu/memory/gc/etc consumption in some workers that I usually run in a rake task. I created a stress test with the code to test but I would like to use derailed_benchmark to get more info.

Is there anyway to do it?

schneems commented 4 years ago

Derailed is implemented internally as rake tasks. You should be able to load up the appropriate file and execute them, though I would recommend shelling out to bundle exec derailed as the internal interfaces are not stable.

https://github.com/schneems/derailed_benchmarks/blob/master/lib/derailed_benchmarks/tasks.rb