mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
Whitespace cleanup.
This commit is contained in:
parent
e91a3aea66
commit
3fe595abd4
6 changed files with 58 additions and 52 deletions
|
@ -159,4 +159,3 @@ def get_new_bucket(connection=None):
|
|||
|
||||
def teardown():
|
||||
nuke_prefixed_buckets()
|
||||
|
||||
|
|
|
@ -113,4 +113,3 @@ if __name__ == '__main__':
|
|||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
common.teardown()
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ class Result:
|
|||
TYPE_NONE = 0
|
||||
TYPE_READER = 1
|
||||
TYPE_WRITER = 2
|
||||
|
||||
def __init__(self, name, type=TYPE_NONE, time=0, success=True, size=0, details=''):
|
||||
self.name = name
|
||||
self.type = type
|
||||
|
@ -37,7 +38,7 @@ class Result:
|
|||
name=self.name,
|
||||
size=self.size,
|
||||
time=self.time,
|
||||
mbps=(self.size/self.time/1024.0),
|
||||
mbps=self.size / self.time / 1024.0,
|
||||
details=self.details
|
||||
)
|
||||
|
||||
|
@ -52,12 +53,14 @@ def reader(seconds, bucket, name=None, queue=None):
|
|||
end = time.clock()
|
||||
elapsed = end - start
|
||||
if queue:
|
||||
queue.put(Result(name,
|
||||
queue.put(
|
||||
Result(
|
||||
name,
|
||||
type=Result.TYPE_READER,
|
||||
time=elapsed,
|
||||
success=fp.valid(),
|
||||
size=(fp.size/1024)
|
||||
)
|
||||
size=fp.size / 1024,
|
||||
),
|
||||
)
|
||||
count += 1
|
||||
if count == 0:
|
||||
|
@ -71,7 +74,12 @@ def writer(seconds, bucket, name=None, queue=None, quantity=1, file_size=1, file
|
|||
if file_name_seed != None:
|
||||
r2 = file_name_seed
|
||||
|
||||
files = generate_objects.get_random_files(quantity, 1024*file_size, 1024*file_stddev, r)
|
||||
files = generate_objects.get_random_files(
|
||||
quantity=quantity,
|
||||
mean=1024 * file_size,
|
||||
stddev=1024 * file_stddev,
|
||||
seed=r,
|
||||
)
|
||||
|
||||
start = time.clock()
|
||||
generate_objects.upload_objects(bucket, files, r2)
|
||||
|
@ -189,4 +197,3 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
|
|
@ -991,7 +991,8 @@ def _simple_http_req_100_cont(host, port, method, resource):
|
|||
req = '{method} {resource} HTTP/1.1\r\nHost: {host}\r\nAccept-Encoding: identity\r\nContent-Length: 123\r\nExpect: 100-continue\r\n\r\n'.format(
|
||||
method=method,
|
||||
resource=resource,
|
||||
host = host)
|
||||
host=host,
|
||||
)
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.settimeout(5)
|
||||
|
|
Loading…
Reference in a new issue