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

[tor-commits] [stem/master] Drop unused load_test example



commit 26d6f781bf97872645067096d272949dcfd4c3d9
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Tue Sep 29 15:12:52 2020 -0700

    Drop unused load_test example
    
    Odd, commit 843facd added this example but didn't link to it within our
    website. Rather than fix the trivial print() bug and test it simply removing.
---
 docs/_static/example/load_test.py | 25 -------------------------
 test/unit/examples.py             |  3 ---
 2 files changed, 28 deletions(-)

diff --git a/docs/_static/example/load_test.py b/docs/_static/example/load_test.py
deleted file mode 100644
index e98e4c00..00000000
--- a/docs/_static/example/load_test.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import os
-import time
-
-import stem.control
-import stem.util.proc
-import stem.util.str_tools
-
-start_time = time.time()
-samplings = []
-last_sample = None
-
-with stem.control.Controller.from_port() as controller:
-  controller.authenticate()
-  controller.add_event_listener(lambda *args: None, 'DEBUG')
-
-  while True:
-    utime, stime = stem.util.proc.stats(os.getpid(), stem.util.proc.Stat.CPU_UTIME, stem.util.proc.Stat.CPU_STIME)
-    total_cpu_time = float(utime) + float(stime)
-
-    if last_sample:
-      samplings.append(total_cpu_time - last_sample)
-      print '%0.1f%% (%s)' % (sum(samplings) / len(samplings) * 100, stem.util.str_tools.time_label(time.time() - start_time))
-
-    last_sample = total_cpu_time
-    time.sleep(1)
diff --git a/test/unit/examples.py b/test/unit/examples.py
index b6eb8016..094322e6 100644
--- a/test/unit/examples.py
+++ b/test/unit/examples.py
@@ -673,9 +673,6 @@ class TestExamples(unittest.TestCase):
 
     self.assertEqual(EXPECTED_LIST_CIRCUITS, stdout_mock.getvalue())
 
-  def test_load_test(self):
-    pass
-
   def test_manual_config_options(self):
     pass
 



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