[or-cvs] [torflow/master 1/2] Fix filter checks.

mikeperry at torproject.org mikeperry at torproject.org
Tue Oct 5 21:12:25 UTC 2010


Author: Mike Perry <mikeperry-git at fscked.org>
Date: Tue, 5 Oct 2010 14:09:33 -0700
Subject: Fix filter checks.
Commit: 8880f56ac73b535c0440fbdef950ccc28c8cba6f

Also, lets report on timeouts. Why not? If a node is timeing out 100% of
the time on urls that timeout for less than 10% of exits, its probably a
sign that the exit is bad.
---
 NetworkScanners/ExitAuthority/cron.sh           |    2 +-
 NetworkScanners/ExitAuthority/snakeinspector.py |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/NetworkScanners/ExitAuthority/cron.sh b/NetworkScanners/ExitAuthority/cron.sh
index 6ffdb14..87c4f34 100755
--- a/NetworkScanners/ExitAuthority/cron.sh
+++ b/NetworkScanners/ExitAuthority/cron.sh
@@ -8,7 +8,7 @@ SCANDIR=~/code/torflow.git/NetworkScanners/ExitAuthority/
 # 4. Only report from urls that fail from less than 10% of the total
 #    exits tested so far. (--siterate 10)
 # 5. Only report exits that fail 100% of their tests (--exitrate 99)
-$SCANDIR/snakeinspector.py --email --noreason FailureTimeout --exitrate 99 --siterate 10 --croninterval 1
+$SCANDIR/snakeinspector.py --email --exitrate 99 --siterate 10 --croninterval 1
 
 # Optionally, you can use these two lines to allow less regular cron
 # scheduling:
diff --git a/NetworkScanners/ExitAuthority/snakeinspector.py b/NetworkScanners/ExitAuthority/snakeinspector.py
index 4fe338e..5211ecd 100755
--- a/NetworkScanners/ExitAuthority/snakeinspector.py
+++ b/NetworkScanners/ExitAuthority/snakeinspector.py
@@ -221,11 +221,14 @@ def main(argv):
         continue
     # Only apply siterate filters if enough tests have run for them to be
     # true. Otherwise, assume they are true (don't check them).
-    if 100.0/conf.siterate > r.site_result_rate[1]:
+    if r.site_result_rate[0] and \
+      100.0/conf.siterate > (1.0*r.site_result_rate[1])/r.site_result_rate[0]:
       if r.site_result_rate[1] != 0 and \
           conf.siterate < (100.0*r.site_result_rate[0])/r.site_result_rate[1]:
         continue
-    if 100.0/(100-conf.exitrate) > r.exit_result_rate[1]:
+    if r.exit_result_rate[0] and \
+      100.0/(100-conf.exitrate) > \
+         (1.0*r.exit_result_rate[1])/r.exit_result_rate[0]:
       if r.exit_result_rate[1] != 0 and \
           conf.exitrate > (100.0*r.exit_result_rate[0])/r.exit_result_rate[1]:
         continue
-- 
1.7.1




More information about the tor-commits mailing list