-
Ensure that you have required gems ('ruby-prof' >= 0.16, 'stackprof')
-
Require
spec_profiling.rb
in yourspec_helper.rb
(or whereever you like) -
To profile the whole suite run:
# Profile with ruby-prof
RUBYPROF=1 rspec ...
# Profile with stackprof
STACKPROF=1 rspec ...
- To profile a separate example mark it with the corresponding tag:
# Profile with StackProf
it "is too slow", :sprof do
...
end
# Profile with RubyProf
it "is too slow", :rprof do
...
end
See https://choosealicense.com/ for tl;dr
Please, please add a license. The fact none is listed makes using this software a legal quagmire. Currently it is not legal to use this code or its derivatives in any useful software. I may be mistaken but hopefully this is not the intended effect.
Currently no license is mentioned anywhere, what makes this code fully copyrighted, like any other creative work.
It limits usefulness of this project - and I hope that it is unintentional. For example it seems that it would solve my problem of profiling hilariously slow rspec tests (
2036.33 seconds ./spec/word_processor_spec.rb:43
), in current situation I would be unable to legally publish project that would use this solution.Obviously, please do not release it under any license if you are not the author (that would be even worse legal quagmire)