AndrewVos
AndrewVos

Reputation: 1295

How do I output performance times for rake tasks

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

Answers (2)

AndrewVos
AndrewVos

Reputation: 1295

Ended up writing this: rake-performance

Upvotes: 3

shawn42
shawn42

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

Related Questions