Commit 4dfb633e authored by Jeremy Hylton's avatar Jeremy Hylton

Merge in zeo-1_0-branch

Remove Python 2.x-isms so that tests run under Python 1.5.2
parent fa0582ce
......@@ -116,7 +116,9 @@ def main(client_func=None):
t0 = time.time()
server_pid, server = start_server(addr)
t1 = time.time()
pids = [start_client(addr, client_func) for i in range(CLIENTS)]
pids = []
for i in range(CLIENTS):
pids.append(start_client(addr, client_func))
for pid in pids:
assert type(pid) == types.IntType, "invalid pid type: %s (%s)" % \
(repr(pid), type(pid))
......
......@@ -243,10 +243,12 @@ def main(args):
results={1:[], 10:[], 100:[], 1000:[]}
if threads > 1:
import threading
l = [threading.Thread(target=work,
args=(db, results, nrep, compress, data,
detailed, minimize, i))
for i in range(threads)]
l = []
for i in range(threads):
t = threading.Thread(target=work,
args=(db, results, nrep, compress, data,
detailed, minimize, i))
l.append(t)
for t in l:
t.start()
for t in l:
......@@ -263,7 +265,9 @@ def main(args):
print '-'*24
print "num\tmean\tmin\tmax"
for r in 1, 10, 100, 1000:
times = [time for time, conf in results[r]]
times = []
for time, conf in results[r]:
times.append(time)
t = mean(times)
print "%d\t%.4f\t%.4f\t%.4f" % (r, t, min(times), max(times))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment