Sha256: a6e931dda5d99e68cca4e9b9dca48a87d2668f3c6d07a39b2808af5f83bcbae1

Contents?: true

Size: 676 Bytes

Versions: 15

Compression:

Stored size: 676 Bytes

Contents

#!/usr/bin/env ruby

LONG_STRING = "lksjhasoh1298alshasoidiohaskjasiouashoasasiugoas" * 6

require File.join(File.dirname(__FILE__), '_common.rb')
db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)
c = db.collection('stress1')

n1 = 50_000
n2 = 10_000

if $DEBUG
  n1 = 5
  n2 = 1
  c.drop
end

n1.times { |i|
  c.insert(:name => "asdf#{i}", :date => Time.now, :id => i,
           :blah => LONG_STRING, :subarray => [])
}
puts

n2.times { |i|
  x = c.find_first({:id => i})
  x['subarray'] = "foo#{i}"
  p x
  c.modify({:id => i}, x)
}
puts

if $DEBUG
  puts "stress1 has #{c.count} records"
  c.find.each { |row| puts "#{row['id']}: #{row['subarray'].inspect}" }
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
animehunter-mongo-0.9 tests/mongo-qa/stress1
mongodb-mongo-0.10.1 tests/mongo-qa/stress1
mongodb-mongo-0.10 tests/mongo-qa/stress1
mongodb-mongo-0.11.1 tests/mongo-qa/stress1
mongodb-mongo-0.11 tests/mongo-qa/stress1
mongodb-mongo-0.6.1 tests/mongo-qa/stress1
mongodb-mongo-0.6.2 tests/mongo-qa/stress1
mongodb-mongo-0.6.3 tests/mongo-qa/stress1
mongodb-mongo-0.6.4 tests/mongo-qa/stress1
mongodb-mongo-0.6.5 tests/mongo-qa/stress1
mongodb-mongo-0.6.6 tests/mongo-qa/stress1
mongodb-mongo-0.6.7 tests/mongo-qa/stress1
mongodb-mongo-0.7 tests/mongo-qa/stress1
mongodb-mongo-0.8 tests/mongo-qa/stress1
mongodb-mongo-0.9 tests/mongo-qa/stress1