]> git.saurik.com Git - redis.git/blame - client-libraries/ruby/benchmarking/suite.rb
client libraries synched in git
[redis.git] / client-libraries / ruby / benchmarking / suite.rb
CommitLineData
d7fc9edb 1require 'fileutils'
2
3def run_in_background(command)
4 fork { system command }
5end
6
7def with_all_segments(&block)
8 0.upto(9) do |segment_number|
9 block_size = 100000
10 start_index = segment_number * block_size
11 end_index = start_index + block_size - 1
12 block.call(start_index, end_index)
13 end
14end
15
16#with_all_segments do |start_index, end_index|
17# puts "Initializing keys from #{start_index} to #{end_index}"
18# system "ruby worker.rb initialize #{start_index} #{end_index} 0"
19#end
20
21with_all_segments do |start_index, end_index|
22 run_in_background "ruby worker.rb write #{start_index} #{end_index} 10"
23 run_in_background "ruby worker.rb read #{start_index} #{end_index} 1"
24end