[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 3f74d9371b8882bfed4463d042610ecced338307
Author: teor <teor@xxxxxxxxxxxxxx>
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)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits