RUBY-248 Verify query speed after failover
This commit is contained in:
parent
6a46bf7aef
commit
2690520afa
|
@ -27,6 +27,8 @@ class ReplicaSetQueryTest < Test::Unit::TestCase
|
|||
assert results.any? {|r| r['a'] == a}, "Could not find record for a => #{a}"
|
||||
end
|
||||
|
||||
puts "Benchmark before failover: #{benchmark_queries}"
|
||||
|
||||
RS.kill_primary
|
||||
|
||||
results = []
|
||||
|
@ -35,7 +37,15 @@ class ReplicaSetQueryTest < Test::Unit::TestCase
|
|||
[20, 30, 40].each do |a|
|
||||
assert results.any? {|r| r['a'] == a}, "Could not find record for a => #{a}"
|
||||
end
|
||||
|
||||
puts "Benchmark after failover: #{benchmark_queries}"
|
||||
end
|
||||
end
|
||||
|
||||
def benchmark_queries
|
||||
t1 = Time.now
|
||||
10000.times { @coll.find_one }
|
||||
Time.now - t1
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue