fix divide by zero in speed calculation for short transfers
This commit is contained in:
parent
3c4054617c
commit
360b0b928d
1 changed files with 2 additions and 0 deletions
|
@ -30,6 +30,8 @@ class TftpMetrics(object):
|
|||
def compute(self):
|
||||
# Compute transfer time
|
||||
self.duration = self.end_time - self.start_time
|
||||
if self.duration == 0:
|
||||
self.duration = 1
|
||||
log.debug("TftpMetrics.compute: duration is %s" % self.duration)
|
||||
self.bps = (self.bytes * 8.0) / self.duration
|
||||
self.kbps = self.bps / 1024.0
|
||||
|
|
Reference in a new issue