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

[or-cvs] r19432: {torflow} Specify stream bandwidth ordering for SQL support printing, (in torflow/trunk: . NetworkScanners)



Author: mikeperry
Date: 2009-05-05 01:25:35 -0400 (Tue, 05 May 2009)
New Revision: 19432

Modified:
   torflow/trunk/NetworkScanners/speedracer.py
   torflow/trunk/metatroller.py
Log:

Specify stream bandwidth ordering for SQL support printing,
fix a bug in speedracer causing us to recompute stats too
often.



Modified: torflow/trunk/NetworkScanners/speedracer.py
===================================================================
--- torflow/trunk/NetworkScanners/speedracer.py	2009-05-05 00:58:31 UTC (rev 19431)
+++ torflow/trunk/NetworkScanners/speedracer.py	2009-05-05 05:25:35 UTC (rev 19432)
@@ -34,7 +34,7 @@
 pct_step = 3
 # Number of fetches per slice:
 count = 250
-save_every = 2
+save_every = 10
 
 class MetatrollerException(Exception):
     "Metatroller does not accept this command."
@@ -124,7 +124,7 @@
         else:
             plog('DEBUG', str(skip) + '-' + str(pct) + '% circuit build+fetch failed for ' + str(build_exit))
 
-        if successful and (successful % save_every) == 0:
+        if ret and successful and (successful % save_every) == 0:
           race_time = strftime("20%y-%m-%d-%H:%M:%S")
           meta.send_command_and_check('CLOSEALLCIRCS')
           meta.send_command_and_check('SAVESTATS '+os.getcwd()+'/data/speedraces/stats-'+str(skip)+':'+str(pct)+"-"+str(successful)+"-"+race_time)

Modified: torflow/trunk/metatroller.py
===================================================================
--- torflow/trunk/metatroller.py	2009-05-05 00:58:31 UTC (rev 19431)
+++ torflow/trunk/metatroller.py	2009-05-05 05:25:35 UTC (rev 19432)
@@ -224,7 +224,7 @@
           plog("DEBUG", "Got sqlite: "+arg)
           use_db = arg
           from TorCtl import SQLSupport
-          SQLSupport.setup_db(use_db, True)
+          SQLSupport.setup_db(use_db, echo=False, drop=True)
           h.add_event_listener(SQLSupport.ConsensusTrackerListener())
           h.add_event_listener(SQLSupport.StreamListener())
           plog("DEBUG", "Did sqlite: "+arg)
@@ -257,7 +257,9 @@
       def notlambda(h):
         cond.acquire()
         SQLSupport.RouterStats.write_stats(file(rfilename, "w"),
-                             percent_skip, percent_fast, recompute=True)
+                             percent_skip, percent_fast, 
+                              order_by=SQLSupport.RouterStats.sbw,
+                              recompute=True)
         cond.notify()
         cond.release()
       cond.acquire()