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