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

[or-cvs] r17975: {torflow} Some comments from review with Karsten. (torflow/trunk/CircuitAnalysis/BuildTimes)



Author: mikeperry
Date: 2009-01-06 15:25:57 -0500 (Tue, 06 Jan 2009)
New Revision: 17975

Modified:
   torflow/trunk/CircuitAnalysis/BuildTimes/buildtimes.py
Log:


Some comments from review with Karsten.



Modified: torflow/trunk/CircuitAnalysis/BuildTimes/buildtimes.py
===================================================================
--- torflow/trunk/CircuitAnalysis/BuildTimes/buildtimes.py	2009-01-06 20:11:47 UTC (rev 17974)
+++ torflow/trunk/CircuitAnalysis/BuildTimes/buildtimes.py	2009-01-06 20:25:57 UTC (rev 17975)
@@ -4,7 +4,7 @@
 
 import socket,sys,time,getopt,os,threading
 sys.path.append("../../")
-from TorCtl.TorUtil import meta_port,meta_host,control_port,control_host
+from TorCtl.TorUtil import meta_port,meta_host,control_port,control_host,control_pass
 from TorCtl.StatsSupport import StatsHandler
 from TorCtl import PathSupport, TorCtl
 
@@ -74,6 +74,7 @@
       if circ_event.status == 'BUILT':
         circ = self.circuits[circ_event.circ_id]
         buildtime = reduce(lambda x,y:x+y,circ.extend_times,0.0)
+        # XXX: Write out circ.extend_times as well to get per-hop data
         self.buildtimesfile.write(str(circ.circ_id) + '\t' + str(buildtime) + '\n')
         self.buildtimesfile.flush()
 
@@ -97,7 +98,7 @@
   s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
   s.connect((control_host,control_port))
   c = PathSupport.Connection(s)
-  c.authenticate()  # also launches thread...
+  c.authenticate(control_pass)  # also launches thread...
   h = StatsGatherer(c,__selmgr,filename,ncircuits)
   c.set_event_handler(h)
 
@@ -179,6 +180,9 @@
     print 'Building circuit',i
     try:
       def notlambda(h):
+        # XXX: reschedule if some number n circuits outstanding?
+        # This may result in a large number of circuits at once..
+        # Potentially also close cicuits periodically or on built
         circ = h.c.build_circuit(h.selmgr.pathlen, h.selmgr.path_selector)   
         h.circuits[circ.circ_id] = circ
       c._handler.schedule_low_prio(notlambda)