Make readwrite test put objects one by one, so it can report keys.

This commit is contained in:
Tommi Virtanen 2011-07-20 10:40:20 -07:00
parent 9e707b897d
commit deb8be9957

View file

@ -53,10 +53,19 @@ def writer(bucket, name, queue, file_size=1, file_stddev=0, file_name_seed=None)
seed=r, seed=r,
) )
names = realistic.names(
mean=15,
stddev=4,
seed=r2,
)
while True: while True:
fp = next(files) fp = next(files)
objname = next(names)
key = bucket.new_key(objname)
start = time.time() start = time.time()
generate_objects.upload_objects(bucket, [fp], r2) key.set_contents_from_file(fp)
end = time.time() end = time.time()
elapsed = end - start elapsed = end - start
@ -64,7 +73,7 @@ def writer(bucket, name, queue, file_size=1, file_stddev=0, file_name_seed=None)
dict( dict(
type='w', type='w',
bucket=bucket.name, bucket=bucket.name,
#TODO this current combines stats for multiple files? key=key.name, key=key.name,
#TODO chunks #TODO chunks
start=start, start=start,
duration=int(round(elapsed * NANOSECOND)), duration=int(round(elapsed * NANOSECOND)),