From 28fcabeed673340d8aec42d51c1cbea89b748212 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Tue, 27 Apr 2010 14:13:45 -0700 Subject: [PATCH] Print flow identification in TCP parsing output. Also fix a division-by-zero bug in computing bandwidth if no data is transferred. --- parsetrace/parse.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parsetrace/parse.py b/parsetrace/parse.py index 4419a35..687dd79 100755 --- a/parsetrace/parse.py +++ b/parsetrace/parse.py @@ -45,11 +45,12 @@ class Connection: print "Network RTT:", rtt print "Additional response delay:", start - rtt print "Transfer time:", end - start - print "Bandwidth:", data / (end - start) + if end - start > 0: + print "Bandwidth:", data / (end - start) print - logfile.write("%d\t%d\t%d\t%f\t%f\t%f\n" + logfile.write("%d\t%d\t%d\t%f\t%f\t%f\t# %s\n" % (self.id, self.transfer_count, data, - rtt, start - rtt, end - start)) + rtt, start - rtt, end - start, self.endpoints)) self.transfer_count += 1 self.times = [] self.state = STATE_START -- 2.20.1