mirror of
https://github.com/ceph/s3-tests.git
synced 2024-12-01 03:49:17 +00:00
Measure and record duration of write and read stages in roundtrip test.
This commit is contained in:
parent
3b15fc7547
commit
561dbe8f0b
1 changed files with 14 additions and 0 deletions
|
@ -168,6 +168,7 @@ def main():
|
||||||
w=config.roundtrip.writers,
|
w=config.roundtrip.writers,
|
||||||
)
|
)
|
||||||
pool = gevent.pool.Pool(size=config.roundtrip.writers)
|
pool = gevent.pool.Pool(size=config.roundtrip.writers)
|
||||||
|
start = time.time()
|
||||||
for objname in objnames:
|
for objname in objnames:
|
||||||
fp = next(files)
|
fp = next(files)
|
||||||
pool.spawn_link_exception(
|
pool.spawn_link_exception(
|
||||||
|
@ -178,6 +179,12 @@ def main():
|
||||||
queue=q,
|
queue=q,
|
||||||
)
|
)
|
||||||
pool.join()
|
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(
|
print "Reading {num} objects with {w} workers...".format(
|
||||||
num=config.roundtrip.files.num,
|
num=config.roundtrip.files.num,
|
||||||
|
@ -186,6 +193,7 @@ def main():
|
||||||
# avoid accessing them in the same order as the writing
|
# avoid accessing them in the same order as the writing
|
||||||
rand.shuffle(objnames)
|
rand.shuffle(objnames)
|
||||||
pool = gevent.pool.Pool(size=config.roundtrip.readers)
|
pool = gevent.pool.Pool(size=config.roundtrip.readers)
|
||||||
|
start = time.time()
|
||||||
for objname in objnames:
|
for objname in objnames:
|
||||||
pool.spawn_link_exception(
|
pool.spawn_link_exception(
|
||||||
reader,
|
reader,
|
||||||
|
@ -194,6 +202,12 @@ def main():
|
||||||
queue=q,
|
queue=q,
|
||||||
)
|
)
|
||||||
pool.join()
|
pool.join()
|
||||||
|
stop = time.time()
|
||||||
|
elapsed = stop - start
|
||||||
|
q.put(dict(
|
||||||
|
type='read_done',
|
||||||
|
duration=int(round(elapsed * NANOSECOND)),
|
||||||
|
))
|
||||||
|
|
||||||
q.put(StopIteration)
|
q.put(StopIteration)
|
||||||
logger_g.get()
|
logger_g.get()
|
||||||
|
|
Loading…
Reference in a new issue