2008-09-05 17:23:47 +00:00
|
|
|
require File.dirname(__FILE__) + '/test_helper'
|
2008-08-26 23:05:20 +00:00
|
|
|
|
2008-09-09 23:33:18 +00:00
|
|
|
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, very small overhead" ) do |test|
|
2008-09-08 16:45:00 +00:00
|
|
|
test.setup{ Mysql.real_connect('localhost','root') }
|
2008-09-09 23:33:18 +00:00
|
|
|
test.per_query_overhead = 0.005
|
2008-09-10 00:26:01 +00:00
|
|
|
test.query_with = :async_query
|
2008-09-08 16:45:00 +00:00
|
|
|
test.run!
|
|
|
|
end
|
|
|
|
|
2008-09-09 23:33:18 +00:00
|
|
|
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, small overhead" ) do |test|
|
2008-09-08 16:45:00 +00:00
|
|
|
test.setup{ Mysql.real_connect('localhost','root') }
|
|
|
|
test.per_query_overhead = 0.1
|
2008-09-10 00:26:01 +00:00
|
|
|
test.query_with = :async_query
|
2008-09-08 16:45:00 +00:00
|
|
|
test.run!
|
|
|
|
end
|
|
|
|
|
2008-09-09 23:33:18 +00:00
|
|
|
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, medium overhead" ) do |test|
|
2008-09-08 16:45:00 +00:00
|
|
|
test.setup{ Mysql.real_connect('localhost','root') }
|
|
|
|
test.per_query_overhead = 1
|
2008-09-10 00:26:01 +00:00
|
|
|
test.query_with = :async_query
|
2008-09-08 16:45:00 +00:00
|
|
|
test.run!
|
|
|
|
end
|
|
|
|
|
2008-09-09 23:33:18 +00:00
|
|
|
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, large overhead" ) do |test|
|
2008-09-08 16:45:00 +00:00
|
|
|
test.setup{ Mysql.real_connect('localhost','root') }
|
|
|
|
test.per_query_overhead = 3
|
2008-09-10 00:26:01 +00:00
|
|
|
test.query_with = :async_query
|
2008-09-08 16:45:00 +00:00
|
|
|
test.run!
|
|
|
|
end
|
|
|
|
|
2008-09-09 23:33:18 +00:00
|
|
|
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, random overhead" ) do |test|
|
2008-09-08 16:45:00 +00:00
|
|
|
test.setup{ Mysql.real_connect('localhost','root') }
|
|
|
|
test.per_query_overhead = :random
|
2008-09-10 00:26:01 +00:00
|
|
|
test.query_with = :async_query
|
2008-09-05 23:54:48 +00:00
|
|
|
test.run!
|
|
|
|
end
|