Commit a26951ca authored by Deathcrow's avatar Deathcrow

bugfix

parent 7d7f33cd
......@@ -281,7 +281,7 @@ for key, i in enumerate(sender):
bandwith_file = open(args.tmp_folder+"/bw_"+i['congestion']+"_"+str(key), 'a')
# print bw for current time interval, convert to Mbps
# pay attention to seq number wrap-around
bw = (int(line_split[4], 0) - last_seq) if (int(line_split[4], 0) - last_seq) > 0 else (int("0xffffffff",0) - last_seq + int(line_split[4], 0))
bw = (int(line_split[4], 0) - last_seq) if (int(line_split[4], 0) - last_seq) >= 0 else (int("0xffffffff",0) - last_seq + int(line_split[4], 0))
bw = bw / abs(float(line_split[0]) - last_timestamp) # byte/s
bw = bw * 8 / 1000 / 1000 # Mbps
bandwith_file.write(" ".join(line_split[:3]+[str(bw)] )+"\n" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment