# HG changeset patch # User Fabien Ninoles # Date 1304910180 14400 # Node ID 55f26e7ee45eb6914c69d1d21c13ef3ef9d18212 # Parent 4b5a51cb5fc7101c6519e3f1d3cc8f016050911c Add randomness to workload. diff -r 4b5a51cb5fc7 -r 55f26e7ee45e collector.py --- a/collector.py Sun May 08 22:58:56 2011 -0400 +++ b/collector.py Sun May 08 23:03:00 2011 -0400 @@ -113,7 +113,7 @@ if failure_rate and random.randrange(failure_rate) == 0: info("worker failed") return False - time.sleep(workload) + time.sleep(workload * (1 + random.random())) debug("worker send reply") socket.send_multipart(address + [request[1], "DONE"]) @@ -174,7 +174,7 @@ workers = [] for url in proxy_urls: for work in xrange(5): - work = threading.Thread(target = connect_worker, args = (url, 1, 4500)) + work = threading.Thread(target = connect_worker, args = (url, 1, 4800)) work.start() workers.append(work) time.sleep(20)