From: Tommi Virtanen Date: Wed, 27 Jul 2011 18:31:00 +0000 (-0700) Subject: Measure and record duration of write and read stages in roundtrip test. X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=561dbe8f0b2290ea598b99dc78a52088f5c3649f;p=s3-tests.git Measure and record duration of write and read stages in roundtrip test. --- diff --git a/s3tests/roundtrip.py b/s3tests/roundtrip.py index e1a0f1c5..0279ad7f 100644 --- a/s3tests/roundtrip.py +++ b/s3tests/roundtrip.py @@ -168,6 +168,7 @@ def main(): w=config.roundtrip.writers, ) pool = gevent.pool.Pool(size=config.roundtrip.writers) + start = time.time() for objname in objnames: fp = next(files) pool.spawn_link_exception( @@ -178,6 +179,12 @@ def main(): queue=q, ) pool.join() + stop = time.time() + elapsed = stop - start + q.put(dict( + type='write_done', + duration=int(round(elapsed * NANOSECOND)), + )) print "Reading {num} objects with {w} workers...".format( num=config.roundtrip.files.num, @@ -186,6 +193,7 @@ def main(): # avoid accessing them in the same order as the writing rand.shuffle(objnames) pool = gevent.pool.Pool(size=config.roundtrip.readers) + start = time.time() for objname in objnames: pool.spawn_link_exception( reader, @@ -194,6 +202,12 @@ def main(): queue=q, ) pool.join() + stop = time.time() + elapsed = stop - start + q.put(dict( + type='read_done', + duration=int(round(elapsed * NANOSECOND)), + )) q.put(StopIteration) logger_g.get()