def pocket_lookup(p, jobid, iter): for i in range(iter): dst_filename = 'tmp' + str(random.randint( 1, 100000000000000)) + '-' + str(i) r = pocket.lookup(p, dst_filename, jobid) if r != 0: raise Exception("lookup failed: " + dst_filename)
def pocket_lookup(p, jobid, iter, id): req_rate = [] t_start = time.time() num_req = 0 for i in xrange(iter): dst_filename = '/tmp'+str(id)+'-'+str(i) r = pocket.lookup(p, dst_filename, jobid) #if r != 0: # raise Exception("lookup failed: "+ dst_filename) num_req += 1 t_now = time.time() if t_now - t_start >=1: req_rate.append(num_req) t_start = time.time() num_req = 0 return req_rate
def pocket_lookup(p, jobid, iter): for i in xrange(iter): dst_filename = '/tmp' + '-' + str(i) r = pocket.lookup(p, dst_filename, jobid) if r != 0: raise Exception("lookup failed: " + dst_filename)
def pocket_lookup(p, jobid, iter): for i in xrange(iter): dst_filename = '/tmp' + '-' + str(i) r = pocket.lookup(p, dst_filename, jobid)