public
Description: A ruby client library for the redis key value storage engine
Homepage:
Clone URL: git://github.com/ezmobius/redis-rb.git
ezmobius (author)
Wed Nov 04 13:52:57 -0800 2009
commit  4c07ac06e94e628ad3ce16dde6729c6ca418bc62
tree    2d214549958bd004627e9ad6595bb0586cedfcc5
parent  edfb1f6d135d4af03b43b896508e0f08842020fb
redis-rb / profile.rb
100644 23 lines (17 sloc) 0.429 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'rubygems'
require 'ruby-prof'
require "#{File.dirname(__FILE__)}/lib/redis"
 
 
mode = ARGV.shift || 'process_time'
n = (ARGV.shift || 200).to_i
 
r = Redis.new
RubyProf.measure_mode = RubyProf.const_get(mode.upcase)
RubyProf.start
 
n.times do |i|
  key = "foo#{i}"
  r[key] = key * 10
  r[key]
end
 
results = RubyProf.stop
File.open("profile.#{mode}", 'w') do |out|
  RubyProf::CallTreePrinter.new(results).print(out)
end