Commit f644e9bd authored by Robert Ricci's avatar Robert Ricci

Unbreak when initial conditions are not in use - ignore tentative

throughput numbers until we get an authoritative measurement.

Note: I've left an XXX for Jon with this commit.
parent 70193861
......@@ -333,9 +333,21 @@ def receive_characteristic(conn):
# bandwidth. This means that we output a throughput number only if
# it is greater than our previous measurements because we don't
# know that bandwidth has decreased.
if int(buf) > connection_bandwidth[dest]:
connection_bandwidth[dest] = int(buf)
set_link(dest, this_ip, 'bandwidth=' + buf)
# If we don't know what the bandwidth is for this host, ignore tentative
# measurments until we find out (due to an authoritative message)
# XXX: It appears that this code only does one of these checks - it's not
# checking wheter the link is saturated or not. This may be correct - since
# the stub is basically doing that already when decideding if the measurment
# is authoritative or not. So, either the code or the comment needs fixing.
if connection_bandwidth.has_key(dest):
if int(buf) > connection_bandwidth[dest]:
connection_bandwidth[dest] = int(buf)
set_link(dest, this_ip, 'bandwidth=' + buf)
else:
sys.stdout.write('ignored TENTATIVE_THROUGHPUT for %s - %i vs %i\n'
% (dest,int(buf), connection_bandwidth[dest]))
else:
sys.stdout.write('ignored TENTATIVE_THROUGHPUT for %s - no data\n' % (dest))
elif eventType == AUTHORITATIVE_BANDWIDTH:
# We know that the bandwidth has definitely changed. Reset everything.
connection_bandwidth[dest] = int(buf)
......
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