[or-cvs] r19890: {torflow} Report bandwidths using the same format as the consensus (10 (torflow/trunk/NetworkScanners/BwAuthority)

mikeperry at seul.org mikeperry at seul.org
Wed Jul 1 19:56:24 UTC 2009


Author: mikeperry
Date: 2009-07-01 15:56:24 -0400 (Wed, 01 Jul 2009)
New Revision: 19890

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

Report bandwidths using the same format as the consensus
(1000-bytes).



Modified: torflow/trunk/NetworkScanners/BwAuthority/aggregate.py
===================================================================
--- torflow/trunk/NetworkScanners/BwAuthority/aggregate.py	2009-07-01 19:50:47 UTC (rev 19889)
+++ torflow/trunk/NetworkScanners/BwAuthority/aggregate.py	2009-07-01 19:56:24 UTC (rev 19890)
@@ -15,7 +15,7 @@
 nodes = {}
 prev_consensus = {}
 ALPHA = 0.3333 # Prev consensus values count for 1/3 of the avg 
-MAX_AGE = 60*60*24*4 # Discard measurements from more than 2 days ago 
+MAX_AGE = 60*60*24*2.5 # Discard measurements from more than 2.5 days ago 
 
 def base10_round(bw_val):
   # This keeps the first 3 decimal digits of the bw value only
@@ -25,7 +25,8 @@
     plog("NOTICE", "Zero bandwidth!")
     return 0
   return int(max((1000,
-                   round(round(bw_val,-(int(math.log10(bw_val))-2)), -3))))
+                   round(round(bw_val,-(int(math.log10(bw_val))-2)),
+                                                       -3)))/1000)
 
 def closest_to_one(ratio_list):
   min_dist = 0x7fffffff



More information about the tor-commits mailing list