Repository URL to install this package:
|
Version:
0.2.8 ▾
|
require 'spec_helper'
describe "Performance" do
before do
@payload = {
test: 123
}
end
it "testing 1000 pushes" do
benchmark = Benchmark.measure do
1000.times { |n| $rrq_conn.push("test_queue", n, @payload) }
end
puts benchmark
end
it "testing 1000 pushes via bulk_push" do
benchmark = Benchmark.measure do
args = 1000.times.to_a.map { @payload }
$rrq_conn.bulk_push("test_queue", 1, args)
end
puts benchmark
end
it "testing 1000 pops" do
1000.times { |n| $rrq_conn.push("test_queue", n, @payload) }
benchmark = Benchmark.measure do
1000.times { |n| $rrq_conn.pop }
end
puts benchmark
end
end