Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I output performance times for rake tasks

Tags:

.net

ruby

rake

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?

like image 731
AndrewVos Avatar asked Jan 27 '11 11:01

AndrewVos


2 Answers

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

like image 88
shawn42 Avatar answered Nov 19 '22 01:11

shawn42


Ended up writing this: rake-performance

like image 3
AndrewVos Avatar answered Nov 18 '22 23:11

AndrewVos