mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
dho qa: update rand readwrite for file generator
Now works correctly again after the changes to the random file generator. Also now gets the true size of files when generating using a stddev != 0 (rather than just assuming all files were the mean size).
This commit is contained in:
parent
e5f9783053
commit
99ef831a0d
1 changed files with 9 additions and 5 deletions
|
@ -67,18 +67,22 @@ def writer(seconds, bucket, name=None, queue=None, quantity=1, file_size=1, file
|
|||
with gevent.Timeout(seconds, False):
|
||||
while (1):
|
||||
r = random.randint(0, 65535)
|
||||
r2 = r
|
||||
if file_name_seed != None:
|
||||
r2 = file_name_seed
|
||||
|
||||
files = generate_objects.get_random_files(quantity, 1024*file_size, 1024*file_stddev, r)
|
||||
|
||||
start = time.clock()
|
||||
generate_objects.generate_objects(bucket, quantity, 1024*file_size, 1024*file_stddev, r,
|
||||
name_seed=file_name_seed
|
||||
)
|
||||
keys = generate_objects.upload_objects(bucket, files, r2)
|
||||
end = time.clock()
|
||||
elapsed = end - start
|
||||
|
||||
if queue:
|
||||
queue.put(Result(name,
|
||||
type=Result.TYPE_WRITER,
|
||||
time=elapsed,
|
||||
size=file_size*quantity,
|
||||
details="stddev={stddev}".format(stddev=file_stddev)
|
||||
size=sum([(file.size/1024) for file in files]),
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue