[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [torflow/master] Display a total of previous consensus bw measured in INFO logs.
commit c2479563d22bd55462d0c923a1f652aff0cb7133
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date: Sun Nov 20 20:52:49 2011 -0800
Display a total of previous consensus bw measured in INFO logs.
---
NetworkScanners/BwAuthority/aggregate.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/NetworkScanners/BwAuthority/aggregate.py b/NetworkScanners/BwAuthority/aggregate.py
index 8e308d1..46b8300 100755
--- a/NetworkScanners/BwAuthority/aggregate.py
+++ b/NetworkScanners/BwAuthority/aggregate.py
@@ -637,7 +637,11 @@ def main(argv):
plog("INFO", "Oldest updated node: "+time.ctime(oldest_updated))
missed_nodes = 0.0
+ missed_bw = 0
+ tot_bw = 0
for n in prev_consensus.itervalues():
+ if n.bandwidth != None:
+ tot_bw += n.bandwidth
if not n.measured:
if "Fast" in n.flags and "Running" in n.flags:
try:
@@ -648,16 +652,21 @@ def main(argv):
#if time.mktime(r.published.utctimetuple()) - r.uptime \
# < oldest_timestamp:
missed_nodes += 1.0
+ if n.bandwidth != None:
+ missed_bw += n.bandwidth
# We still tend to miss about 80 nodes even with these
# checks.. Possibly going in and out of hibernation?
plog("DEBUG", "Didn't measure "+n.idhex+"="+n.nickname+" at "+str(round((100.0*n.list_rank)/max_rank,1))+" "+str(n.bandwidth))
measured_pct = round(100.0*len(nodes)/(len(nodes)+missed_nodes),1)
+ measured_bw_pct = round((100.0*missed_bw)/tot_bw,1)
if measured_pct < MIN_REPORT:
plog("NOTICE", "Did not measure "+str(MIN_REPORT)+"% of nodes yet ("+str(measured_pct)+"%)")
sys.exit(1)
- plog("INFO", "Measured "+str(measured_pct)+"% of all tor nodes.")
+ plog("INFO",
+ "Measured "+str(measured_pct) +"% of all tor nodes ("
+ +str(measured_bw_pct)+"% of previous consensus bw).")
n_print = nodes.values()
n_print.sort(lambda x,y: int(y.pid_error*1000) - int(x.pid_error*1000))
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits