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

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



commit f8f2890502721a8bc47ba6997e5984fc40e303a2
Author: Arturo Filastò <art@xxxxxxxxx>
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)



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