[or-cvs] r20156: {torflow} Woops, use alpha-adjusted bandwidth when calculating changed (torflow/trunk/NetworkScanners/BwAuthority)

mikeperry at seul.org mikeperry at seul.org
Mon Jul 27 04:52:16 UTC 2009


Author: mikeperry
Date: 2009-07-27 00:52:15 -0400 (Mon, 27 Jul 2009)
New Revision: 20156

Modified:
   torflow/trunk/NetworkScanners/BwAuthority/aggregate.py
Log:

Woops, use alpha-adjusted bandwidth when calculating changed
bandwidths.



Modified: torflow/trunk/NetworkScanners/BwAuthority/aggregate.py
===================================================================
--- torflow/trunk/NetworkScanners/BwAuthority/aggregate.py	2009-07-27 01:12:55 UTC (rev 20155)
+++ torflow/trunk/NetworkScanners/BwAuthority/aggregate.py	2009-07-27 04:52:15 UTC (rev 20156)
@@ -249,17 +249,18 @@
       n.ratio = n.sbw_ratio
       n.new_bw = n.ns_bw[n.chosen_sbw]*n.ratio
       n.chosen_time = n.timestamps[n.chosen_sbw]
-      n.change = n.new_bw - n.ns_bw[n.chosen_sbw]
+      n.change = 0 - n.ns_bw[n.chosen_sbw]
     else:
       n.ratio = n.fbw_ratio
       n.new_bw = n.ns_bw[n.chosen_fbw]*n.ratio
       n.chosen_time = n.timestamps[n.chosen_fbw]
-      n.change = n.new_bw - n.ns_bw[n.chosen_fbw]
+      n.change = 0 - n.ns_bw[n.chosen_fbw]
     if n.idhex in prev_consensus and prev_consensus[n.idhex].bandwidth != None:
       prev_consensus[n.idhex].measured = True
       # XXX: Maybe we should base this on the consensus value
       # at the time of measurement from the Node class.
       n.new_bw = ((prev_consensus[n.idhex].bandwidth*ALPHA + n.new_bw)/(ALPHA + 1))
+    n.change += n.new_bw
 
   oldest_timestamp = min(map(lambda n: n.chosen_time,
              filter(lambda n: n.idhex in prev_consensus,



More information about the tor-commits mailing list