[or-cvs] r21477: {torflow} Fix some exceptions. Add support for RESUME event so we can (torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test)

Mike Perry mikeperry-svn at fscked.org
Fri Jan 22 22:14:53 UTC 2010


Author: mikeperry
Date: 2010-01-22 22:14:53 +0000 (Fri, 22 Jan 2010)
New Revision: 21477

Modified:
   torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/TODO_EXPERIMENTS
   torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbtshow.py
   torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbttest.py
Log:

Fix some exceptions. Add support for RESUME event so we can
adjust for network loss.



Modified: torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/TODO_EXPERIMENTS
===================================================================
--- torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/TODO_EXPERIMENTS	2010-01-22 20:46:37 UTC (rev 21476)
+++ torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/TODO_EXPERIMENTS	2010-01-22 22:14:53 UTC (rev 21477)
@@ -1,4 +1,3 @@
-
 - regular broadband run
 - 250ms +/- 20%
 - 500ms +/- 20%
@@ -17,7 +16,8 @@
 - 1s  +/- 20% + 10% loss
 - 2s  +/- 20% + 10% loss
 
+Plan: Only break down broadband results by percentile.
+Gather stats on ping times too
 
 
 
-

Modified: torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbtshow.py
===================================================================
--- torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbtshow.py	2010-01-22 20:46:37 UTC (rev 21476)
+++ torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbtshow.py	2010-01-22 22:14:53 UTC (rev 21477)
@@ -51,6 +51,7 @@
         for ds in dirs:
           if re.match("^redo.[\d+]$", ds):
             for sr, sd, sf in os.walk(pct_dir+"/"+pct_run+"/"+ds):
+              built = num_circ = num_timeout = 0
               for f in sf:
                 if f == "result":
                   r = open(pct_dir+"/"+pct_run+"/"+ds+"/"+f)
@@ -73,7 +74,7 @@
                   built_succeed_tot += built
                   built_tot += total
                   redo_built_rates.append(float(built)/total)
-              if built <= 0 or num_circs <= 0 or num_timeout <= 0:
+              if built <= 0 or num_circ <= 0 or num_timeout <= 0:
                 continue
 
 

Modified: torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbttest.py
===================================================================
--- torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbttest.py	2010-01-22 20:46:37 UTC (rev 21476)
+++ torflow/trunk/CircuitAnalysis/BuildTimes/CBT-Test/cbttest.py	2010-01-22 22:14:53 UTC (rev 21477)
@@ -74,8 +74,12 @@
 
   def heartbeat_event(self, event):
     if len(self.live_circs) < MAX_CIRCUITS:
-       circ_id = self.c.extend_circuit()
-       plog("INFO", "Launched circuit: "+str(circ_id))
+       try:
+         circ_id = self.c.extend_circuit()
+         plog("INFO", "Launched circuit: "+str(circ_id))
+       except TorCtl.ErrorReply, e:
+         plog("WARN", "Can't extend circuit: "+str(e))
+         #traceback.print_exc()
 
   def guard_event(self, event):
     changed = False
@@ -196,6 +200,12 @@
     self.timeouts_file.write(bt_event.set_type+" "
                +str(bt_event.total_times)+" "+str(bt_event.timeout_ms)+"\n")
 
+    if bt_event.set_type == "RESUME":
+      plog("NOTICE",
+           "Got resume event. Resetting total count to: "+str(self.total_times))
+      self.total_times = bt_event.total_times
+      return
+
     # Need to handle RESET events..
     # Should these count towards our totals, or should we just start
     # over? Probably, but then that breaks a lot of our asserts
@@ -217,6 +227,9 @@
       self.reset()
       return
 
+    if bt_event.set_type != "COMPUTED":
+      return
+
     if not self.total_times:
       self.total_times = bt_event.total_times-1
     self.total_times +=1
@@ -267,8 +280,14 @@
       try: os.unlink(output_dir+"/state.min")
       except: pass
     elif not self.cond.min_circs:
-      assert(self.fuzzy_streak_count ==
-              (bt_event.total_times - self.buildtimeout_fuzzy.total_times))
+      if (self.fuzzy_streak_count != (bt_event.total_times -
+                 self.buildtimeout_fuzzy.total_times)):
+        plog("WARN",
+             "Fuzzy count doesn't match: "+str(self.fuzzy_streak_count)+
+             " != "+str(bt_event.total_times)
+                     +"-"+str(self.buildtimeout_fuzzy.total_times))
+        #assert(self.fuzzy_streak_count ==
+        #      (bt_event.total_times - self.buildtimeout_fuzzy.total_times))
       self.fuzzy_streak_count += 1
       if (self.fuzzy_streak_count >= self.total_times*FUZZY_RATIO):
         plog("NOTICE",
@@ -311,8 +330,8 @@
              "Streak count doesn't match: "+str(self.strict_streak_count)+
              " != "+str(bt_event.total_times)
                      +"-"+str(self.buildtimeout_strict.total_times))
-        assert(self.strict_streak_count ==
-              (bt_event.total_times - self.buildtimeout_strict.total_times))
+        #assert(self.strict_streak_count ==
+        #      (bt_event.total_times - self.buildtimeout_strict.total_times))
       self.strict_streak_count += 1
       if (self.cond.min_circs and self.strict_streak_count >= self.total_times*STRICT_RATIO):
         plog("NOTICE",



More information about the tor-commits mailing list