[tor-commits] [ooni-probe/master] Write the number of currently running tasks to a text file

art at torproject.org art at torproject.org
Tue Aug 27 10:03:52 UTC 2013


commit f8f2890502721a8bc47ba6997e5984fc40e303a2
Author: Arturo Filastò <art at fuffa.org>
Date:   Thu Aug 22 15:40:23 2013 +0200

    Write the number of currently running tasks to a text file
---
 ooni/nettest.py |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ooni/nettest.py b/ooni/nettest.py
index 4c1c6fa..53dcb15 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -403,6 +403,10 @@ class NetTestState(object):
     def checkAllTasksDone(self):
         log.debug("Checking all tasks for completion %s == %s" %
                   (self.doneTasks, self.tasks))
+        with open('task_count_log.txt', 'a+') as f:
+            diff = int(self.tasks) - int(self.doneTasks)
+            f.write("%s, %s, %s, %s\n" % (otime.timestamp(), self.doneTasks, self.tasks, diff))
+
         if self.completedScheduling and \
                 self.doneTasks == self.tasks:
             self.allTasksDone.callback(self.doneTasks)





More information about the tor-commits mailing list