def run(self): accesses = get_random_accesses(NumCalls) timer = Timer() timer.start() self.bulk_op = self.db.bench.initialize_unordered_bulk_op() for i in accesses: self.do_bench_call(i) self.bulk_op.execute({'w' : self.writes }) return timer.stop()
def run(self): pendingOps = [] accesses = get_random_accesses(NumCalls) timer = Timer() timer.start() for i in accesses: p = self.do_bench_call(i) pendingOps.append(p) while len(pendingOps) > 0: pendingOps[0].wait() pendingOps.pop(0) return timer.stop()