Sha256: c3c3bbfa6d04eef625ea48847d49496a2eddffc55a5eaca5b5598e3aaa0846f3

Contents?: true

Size: 574 Bytes

Versions: 4

Compression:

Stored size: 574 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'mongo')
require 'logger'

$con = Mongo::ReplSetConnection.new(['localhost', 30000], ['localhost', 30001], :read => :secondary, :refresh_mode => :sync, :refresh_interval => 30)
$db = $con['foo']

class Load < Sinatra::Base

  configure do
    LOGGER = Logger.new("sinatra.log")
    enable :logging, :dump_errors
    set :raise_errors, true
  end

  get '/' do
    $db['test'].insert({:a => rand(1000)})
    $db['test'].find({:a => {'$gt' => rand(2)}}, :read => :secondary).limit(2).to_a
    "ok"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongo-1.5.2 test/load/thin/load.rb
mongo-1.5.1 test/load/thin/load.rb
mongo-1.5.0 test/load/thin/load.rb
mongo-1.5.0.rc0 test/load/thin/load.rb