mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
more repitition for benchs
This commit is contained in:
parent
f82f0d450d
commit
a9b56db2e4
1 changed files with 16 additions and 6 deletions
22
bench.rb
22
bench.rb
|
@ -17,6 +17,8 @@ raws = RightAws::S3Interface.new(
|
||||||
)
|
)
|
||||||
raws.logger.level = 3 # ERROR
|
raws.logger.level = 3 # ERROR
|
||||||
|
|
||||||
|
TIMES = 10
|
||||||
|
|
||||||
Benchmark.bm(25) do |bench|
|
Benchmark.bm(25) do |bench|
|
||||||
bench.report('fog.put_bucket') do
|
bench.report('fog.put_bucket') do
|
||||||
fog.put_bucket('fogbench')
|
fog.put_bucket('fogbench')
|
||||||
|
@ -28,21 +30,29 @@ Benchmark.bm(25) do |bench|
|
||||||
print '-' * 64 << "\n"
|
print '-' * 64 << "\n"
|
||||||
|
|
||||||
bench.report('fog.put_object') do
|
bench.report('fog.put_object') do
|
||||||
file = File.open(File.dirname(__FILE__) + '/spec/lorem.txt', 'r')
|
TIMES.times do |x|
|
||||||
fog.put_object('fogbench', 'lorem', file)
|
file = File.open(File.dirname(__FILE__) + '/spec/lorem.txt', 'r')
|
||||||
|
fog.put_object('fogbench', "lorem_#{x}", file)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
bench.report('raws.put') do
|
bench.report('raws.put') do
|
||||||
file = File.open(File.dirname(__FILE__) + '/spec/lorem.txt', 'r')
|
TIMES.times do |x|
|
||||||
raws.put('rawsbench', 'lorem', file)
|
file = File.open(File.dirname(__FILE__) + '/spec/lorem.txt', 'r')
|
||||||
|
raws.put('rawsbench', "lorem_#{x}", file)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print '-' * 64 << "\n"
|
print '-' * 64 << "\n"
|
||||||
|
|
||||||
bench.report('fog.delete_object') do
|
bench.report('fog.delete_object') do
|
||||||
fog.delete_object('fogbench', 'lorem')
|
TIMES.times do |x|
|
||||||
|
fog.delete_object('fogbench', "lorem_#{x}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
bench.report('raws.delete') do
|
bench.report('raws.delete') do
|
||||||
raws.delete('rawsbench', 'lorem')
|
TIMES.times do |x|
|
||||||
|
raws.delete('rawsbench', "lorem_#{x}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print '-' * 64 << "\n"
|
print '-' * 64 << "\n"
|
||||||
|
|
Loading…
Reference in a new issue