forked from TrueCloudLab/s3-tests
fix zero devision error in readwrite test
Was dividing by 0 if somehow it managed to upload or download a file in under .01 seconds.
This commit is contained in:
parent
91c4f88860
commit
7b51f55a1b
1 changed files with 6 additions and 1 deletions
|
@ -32,13 +32,18 @@ class Result:
|
||||||
else:
|
else:
|
||||||
status = 'FAILURE'
|
status = 'FAILURE'
|
||||||
|
|
||||||
|
if (self.time == 0):
|
||||||
|
mbps = '?'
|
||||||
|
else:
|
||||||
|
mbps = self.size / self.time / 1024.0
|
||||||
|
|
||||||
return "<Result: [{success}] {type}{name} -- {size} KB in {time}s = {mbps} MB/s {details}>".format(
|
return "<Result: [{success}] {type}{name} -- {size} KB in {time}s = {mbps} MB/s {details}>".format(
|
||||||
success=status,
|
success=status,
|
||||||
type=type_s,
|
type=type_s,
|
||||||
name=self.name,
|
name=self.name,
|
||||||
size=self.size,
|
size=self.size,
|
||||||
time=self.time,
|
time=self.time,
|
||||||
mbps=self.size / self.time / 1024.0,
|
mbps=mbps,
|
||||||
details=self.details
|
details=self.details
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue