From 160580c1555f3ff96c2cc6a4f20c9215217ee44d Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 15 Mar 2010 14:37:38 -0700 Subject: [PATCH] Two minor tweaks. --- benchmarks/localhost_socket.py | 7 ++++++- eventlet/pools.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/benchmarks/localhost_socket.py b/benchmarks/localhost_socket.py index f249255..4e740e4 100644 --- a/benchmarks/localhost_socket.py +++ b/benchmarks/localhost_socket.py @@ -6,6 +6,7 @@ import benchmarks BYTES=1000 SIZE=1 CONCURRENCY=50 +TRIES=5 def reader(sock): expect = BYTES @@ -82,16 +83,20 @@ if __name__ == "__main__": default=SIZE) parser.add_option('-c', '--concurrency', type='int', dest='concurrency', default=CONCURRENCY) + parser.add_option('-t', '--tries', type='int', dest='tries', + default=TRIES) + opts, args = parser.parse_args() BYTES=opts.bytes SIZE=opts.size CONCURRENCY=opts.concurrency + TRIES=opts.tries funcs = [launch_green_threads] if opts.threading: funcs = [launch_green_threads, launch_heavy_threads] - results = benchmarks.measure_best(3, 3, + results = benchmarks.measure_best(TRIES, 3, lambda: None, lambda: None, *funcs) print "green:", results[launch_green_threads] diff --git a/eventlet/pools.py b/eventlet/pools.py index 39544bb..0733f95 100644 --- a/eventlet/pools.py +++ b/eventlet/pools.py @@ -49,7 +49,7 @@ class Pool(object): http_pool = pools.Pool(create=lambda: httplib2.Http(timeout=90)) - or `functools.partial`:: + or :func:`functools.partial`:: from functools import partial http_pool = pools.Pool(create=partial(httplib2.Http, timeout=90))