]> git.saurik.com Git - redis.git/blame_incremental - client-libraries/ruby/profile.rb
max inline request raised again to 1024*1024*256 bytes
[redis.git] / client-libraries / ruby / profile.rb
... / ...
CommitLineData
1require 'rubygems'
2require 'ruby-prof'
3require "#{File.dirname(__FILE__)}/lib/redis"
4
5
6mode = ARGV.shift || 'process_time'
7n = (ARGV.shift || 200).to_i
8
9r = Redis.new
10RubyProf.measure_mode = RubyProf.const_get(mode.upcase)
11RubyProf.start
12
13n.times do |i|
14 key = "foo#{i}"
15 r[key] = key * 10
16 r[key]
17end
18
19results = RubyProf.stop
20File.open("profile.#{mode}", 'w') do |out|
21 RubyProf::CallTreePrinter.new(results).print(out)
22end