Browse Source

Update the circuit creation progress bar by number of circuits, not simulated time

Ian Goldberg 4 years ago
parent
commit
4697562c37
1 changed files with 6 additions and 3 deletions
  1. 6 3
      simulator.py

+ 6 - 3
simulator.py

@@ -88,6 +88,7 @@ class Simulator:
         # simtime is the simulated time, measured in epochs (i.e.,
         # 0=start of this epoch; 1=end of this epoch)
         simtime = 0
+        numcircs = 0
 
         allcircs = []
 
@@ -96,10 +97,12 @@ class Simulator:
             allcircs.append(
                     random.choice(self.clients).channelmgr.new_circuit())
             simtime += random.expovariate(self.gamma * numclients)
+            numcircs += 1
             percent = int(100*simtime)
-            if percent != lastpercent:
-                logging.info("Creating circuits in epoch %s: %d%%",
-                        epoch, percent)
+            #if percent != lastpercent:
+            if numcircs % 100 == 0:
+                logging.info("Creating circuits in epoch %s: %d%% (%d circuits)",
+                        epoch, percent, numcircs)
                 lastpercent = percent
 
         # gather stats