[tor-commits] [sbws/master] scanner: add documentation to function that run scanner

juga at torproject.org juga at torproject.org
Mon Feb 4 14:57:14 UTC 2019

commit c24b2354d96269e4f126762256ffe1535bd4426d
Author: juga0 <juga at riseup.net>
Date:   Wed Jan 23 09:02:30 2019 +0000

    scanner: add documentation to function that run scanner
 sbws/core/scanner.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sbws/core/scanner.py b/sbws/core/scanner.py
index 08fb35a..bb7a2ca 100644
--- a/sbws/core/scanner.py
+++ b/sbws/core/scanner.py
@@ -439,6 +439,22 @@ def main_loop(args, conf, controller, relay_list, circuit_builder, result_dump,
 def run_speedtest(args, conf):
+    """Initializes all the data and threads needed to measure the relays.
+    It launches or connect to Tor in a thread.
+    It initializes the list of relays seen in the Tor network.
+    It starts a thread to read the previous measurements and wait for new
+    measurements to write them to the disk.
+    It initializes a class that will be used to order the relays depending
+    on their measurements age.
+    It initializes the list of destinations that will be used for the
+    measurements.
+    It initializes the thread pool that will launch the measurement threads.
+    The pool starts 3 other threads that are not the measurement (worker)
+    threads.
+    Finally, it calls the function that will manage the measurement threads.
+    """
     global rd, pool, controller
     controller, _ = stem_utils.init_controller(
         path=conf.getpath('tor', 'control_socket'))

More information about the tor-commits mailing list