oldmoe / mysqlplus

An enhanced mysql driver with an async interface and threaded access support

This URL has Read+Write access

mysqlplus / test / native_threaded_test.rb
100644 36 lines (31 sloc) 1.164 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require File.dirname(__FILE__) + '/test_helper'
 
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, very small overhead" ) do |test|
  test.setup{ Mysql.real_connect('localhost','root') }
  test.per_query_overhead = 0.005
  test.query_with = :async_query
  test.run!
end
 
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, small overhead" ) do |test|
  test.setup{ Mysql.real_connect('localhost','root') }
  test.per_query_overhead = 0.1
  test.query_with = :async_query
  test.run!
end
 
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, medium overhead" ) do |test|
  test.setup{ Mysql.real_connect('localhost','root') }
  test.per_query_overhead = 1
  test.query_with = :async_query
  test.run!
end
 
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, large overhead" ) do |test|
  test.setup{ Mysql.real_connect('localhost','root') }
  test.per_query_overhead = 3
  test.query_with = :async_query
  test.run!
end
 
ThreadedMysqlTest.new( 10, "Threaded, native Ruby, random overhead" ) do |test|
  test.setup{ Mysql.real_connect('localhost','root') }
  test.per_query_overhead = :random
  test.query_with = :async_query
  test.run!
end