Gem to bechmark your methods

7 views
Skip to first unread message

Igor Kasyanchuk

unread,
Oct 12, 2015, 2:14:46 PM10/12/15
to rubyonra...@googlegroups.com
Benchmark and measure execution time your Ruby methods without an
additional code changes:
https://github.com/igorkasyanchuk/benchmark_methods
Please put a star if you like it!
Thank you! Your feedback is appreciated.

Sample:
class User < ActiveRecord::Base
include BenchmarkMethods

benchmark :generate_report
cbenchmark :import_users

def generate_report
report = reports.create(name: 'My Report')
report.add_db_data
report.generate
report
end

def self.import_users(csv)
CSV.parse(csv) do |row|
process_import_user(row)
end
end
end

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages