Updated resent_data in metrics.
parent
3ae3b31bf4
commit
781072bfe8
|
@ -59,8 +59,8 @@ class TftpClient(TftpSession):
|
|||
log.info("Duration too short, rate undetermined")
|
||||
else:
|
||||
log.info("Downloaded %.2f bytes in %.2f seconds" % (metrics.bytes, metrics.duration))
|
||||
log.info("%.2f bytes in resent data" % metrics.resend_bytes)
|
||||
log.info("Average rate: %.2f kbps" % metrics.kbps)
|
||||
log.info("%.2f bytes in resent data" % metrics.resent_bytes)
|
||||
log.info("Received %d duplicate packets" % metrics.dupcount)
|
||||
|
||||
def upload(self, filename, input, packethook=None, timeout=SOCK_TIMEOUT):
|
||||
|
@ -86,6 +86,6 @@ class TftpClient(TftpSession):
|
|||
log.info("Duration too short, rate undetermined")
|
||||
else:
|
||||
log.info("Uploaded %.2f bytes in %.2f seconds" % (metrics.bytes, metrics.duration))
|
||||
log.info("%.2f bytes in resent data" % metrics.resend_bytes)
|
||||
log.info("Average rate: %.2f kbps" % metrics.kbps)
|
||||
log.info("%.2f bytes in resent data" % metrics.resent_bytes)
|
||||
log.info("Resent %d packets" % metrics.dupcount)
|
||||
|
|
|
@ -151,9 +151,8 @@ class TftpServer(TftpSession):
|
|||
else:
|
||||
log.info("Transferred %.2f bytes in %.2f seconds"
|
||||
% (metrics.bytes, metrics.duration))
|
||||
log.info("%.2f bytes in resent data"
|
||||
% metrics.resend_bytes)
|
||||
log.info("Average rate: %.2f kbps" % metrics.kbps)
|
||||
log.info("%.2f bytes in resent data" % metrics.resent_bytes)
|
||||
log.info("%d duplicate packets" % metrics.dupcount)
|
||||
log.debug("Deleting session %s" % key)
|
||||
del self.sessions[key]
|
||||
|
|
|
@ -13,7 +13,7 @@ class TftpMetrics(object):
|
|||
# Bytes transferred
|
||||
self.bytes = 0
|
||||
# Bytes re-sent
|
||||
self.resend_bytes = 0
|
||||
self.resent_bytes = 0
|
||||
# Duplicate packets received
|
||||
self.dups = {}
|
||||
self.dupcount = 0
|
||||
|
@ -439,7 +439,7 @@ class TftpState(object):
|
|||
if resend:
|
||||
log.warn("Resending block number %d" % blocknumber)
|
||||
dat = self.context.last_dat_pkt
|
||||
self.context.metrics.resend_bytes += len(dat.data)
|
||||
self.context.metrics.resent_bytes += len(dat.data)
|
||||
self.context.metrics.add_dup(dat)
|
||||
else:
|
||||
blksize = int(self.context.options['blksize'])
|
||||
|
|
Reference in New Issue