def testspeed(total=1): p = Pubsub(listen=False) j = p.job("jobtest") start = time.time() for x in range(1,total+1): j.publish(x) tt = time.time() - start print tt, total / tt
def testspeed(total=1): p = Pubsub(listen=False) j = p.job("jobtest") start = time.time() for x in range(1, total + 1): j.publish(x) tt = time.time() - start print(tt, total / tt)
def runjobs(listen=False): p = Pubsub() job_channel = p.job("jobtest") x = 0 starttime = time.time() while True: id, query = job_channel.get() #if x%2: job_channel.finish(id, query) x += 1 if time.time() > starttime + 1.0: print("%d/sec" % x) x = 0 starttime = time.time()
def runjobs(listen=False): p = Pubsub() job_channel = p.job("jobtest") x = 0 starttime = time.time() while True: id, query = job_channel.get() # if x%2: job_channel.finish(id, query) x += 1 if time.time() > starttime + 1.0: print "%d/sec" % x x = 0 starttime = time.time()