Reputation: 1295
I'm working on rake tasks for a large .net solution (using the albacore gem) and I want to be able to record to a file start and stop times for any rake tasks that run to try and speed up our build and locate bottlenecks. Is there anything built in that I can use, or do I need to write something?
Upvotes: 5
Views: 2812
Reputation: 439
There is a simple benchmarking library in Ruby's Stdlib:
require 'benchmark'
puts Benchmark.measure { "a"*1_000_000 }
You could drop that in your rake tasks, as for an automatic "benchmark all rake task executions", that would take a little digging into the innards of rake.
More info at: http://ruby-doc.org/stdlib/libdoc/benchmark/rdoc/index.html
Upvotes: 3