[tor-commits] [sbws/master] Exclude results, then check for the minimum number

juga at torproject.org juga at torproject.org
Fri Nov 23 07:38:09 UTC 2018


commit 3f74d9371b8882bfed4463d042610ecced338307
Author: teor <teor at torproject.org>
Date:   Thu Nov 22 18:27:53 2018 +1000

    Exclude results, then check for the minimum number
    
    sbws should exclude results, then check for the minimum number of results.
    
    Closes bug 28572.
---
 sbws/lib/v3bwfile.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index a4511c7..a050744 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -315,9 +315,6 @@ class V3BWLine(object):
         kwargs.update(cls.result_types_from_results(results))
         # useful args for scaling
         if success_results:
-            if not len(success_results) >= min_num:
-                # log.debug('The number of results is les than %s', min_num)
-                return None
             results_away = \
                 cls.results_away_each_other(success_results, secs_away)
             if not results_away:
@@ -327,6 +324,9 @@ class V3BWLine(object):
             results_recent = cls.results_recent_than(results_away, secs_recent)
             if not results_recent:
                 return None
+            if not len(results_recent) >= min_num:
+                # log.debug('The number of results is less than %s', min_num)
+                return None
             kwargs['desc_bw_avg'] = \
                 results_recent[-1].relay_average_bandwidth
             rtt = cls.rtt_from_results(results_recent)





More information about the tor-commits mailing list