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): ...@@ -116,7 +116,9 @@ def main(client_func=None):
t0 = time.time() t0 = time.time()
server_pid, server = start_server(addr) server_pid, server = start_server(addr)
t1 = time.time() 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: for pid in pids:
assert type(pid) == types.IntType, "invalid pid type: %s (%s)" % \ assert type(pid) == types.IntType, "invalid pid type: %s (%s)" % \
(repr(pid), type(pid)) (repr(pid), type(pid))
......
...@@ -243,10 +243,12 @@ def main(args): ...@@ -243,10 +243,12 @@ def main(args):
results={1:[], 10:[], 100:[], 1000:[]} results={1:[], 10:[], 100:[], 1000:[]}
if threads > 1: if threads > 1:
import threading import threading
l = [threading.Thread(target=work, l = []
for i in range(threads):
t = threading.Thread(target=work,
args=(db, results, nrep, compress, data, args=(db, results, nrep, compress, data,
detailed, minimize, i)) detailed, minimize, i))
for i in range(threads)] l.append(t)
for t in l: for t in l:
t.start() t.start()
for t in l: for t in l:
...@@ -263,7 +265,9 @@ def main(args): ...@@ -263,7 +265,9 @@ def main(args):
print '-'*24 print '-'*24
print "num\tmean\tmin\tmax" print "num\tmean\tmin\tmax"
for r in 1, 10, 100, 1000: 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) t = mean(times)
print "%d\t%.4f\t%.4f\t%.4f" % (r, t, min(times), max(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