[or-cvs] r21409: {torctl} Add extra pareto info to BUILDTIMEOUT_SET events. (torctl/trunk/python/TorCtl)

Mike Perry mikeperry-svn at fscked.org
Wed Jan 13 21:40:12 UTC 2010


Author: mikeperry
Date: 2010-01-13 21:40:11 +0000 (Wed, 13 Jan 2010)
New Revision: 21409

Modified:
   torctl/trunk/python/TorCtl/TorCtl.py
Log:

Add extra pareto info to BUILDTIMEOUT_SET events.



Modified: torctl/trunk/python/TorCtl/TorCtl.py
===================================================================
--- torctl/trunk/python/TorCtl/TorCtl.py	2010-01-12 18:41:24 UTC (rev 21408)
+++ torctl/trunk/python/TorCtl/TorCtl.py	2010-01-13 21:40:11 UTC (rev 21409)
@@ -141,11 +141,15 @@
     self.status = status
 
 class BuildTimeoutSetEvent(Event):
-  def __init__(self, event_name, set_type, total_times, timeout_ms):
+  def __init__(self, event_name, set_type, total_times, timeout_ms, xm, alpha,
+               quantile):
     Event.__init__(self, event_name)
     self.set_type = set_type
     self.total_times = total_times
     self.timeout_ms = timeout_ms
+    self.xm = xm
+    self.alpha = alpha
+    self.cutoff_quantile = quantile
 
 class CircuitEvent(Event):
   def __init__(self, event_name, circ_id, status, path, purpose,
@@ -1203,10 +1207,13 @@
     elif evtype == "NEWCONSENSUS":
       event = NewConsensusEvent(evtype, parse_ns_body(data))
     elif evtype == "BUILDTIMEOUT_SET":
-      m = re.match(r"(\S+)\sTOTAL_TIMES=(\d+)\sTIMEOUT_MS=(\d+)", body)
-      set_type, total_times, timeout_ms = m.groups()
+      m = re.match(
+        r"(\S+)\sTOTAL_TIMES=(\d+)\sTIMEOUT_MS=(\d+)\sXM=(\d+)\sALPHA=(\S+)\sCUTOFF_QUANTILE=(\S+)",
+        body)
+      set_type, total_times, timeout_ms, xm, alpha, quantile = m.groups()
       event = BuildTimeoutSetEvent(evtype, set_type, int(total_times),
-                                   int(timeout_ms))
+                                   int(timeout_ms), int(xm), float(alpha),
+                                   float(quantile))
     elif evtype == "GUARD":
       m = re.match(r"(\S+)\s(\S+)\s(\S+)", body)
       entry, guard, status = m.groups()



More information about the tor-commits mailing list