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

[tor-commits] [onionoo/master] Log back-end performance to find bottlenecks.



commit d49ab37d9ab06b175013d94ba7c56f0c947e82a9
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Wed Apr 10 10:23:20 2013 +0200

    Log back-end performance to find bottlenecks.
---
 src/org/torproject/onionoo/Main.java |   38 ++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/org/torproject/onionoo/Main.java b/src/org/torproject/onionoo/Main.java
index af45221..e83e4b5 100644
--- a/src/org/torproject/onionoo/Main.java
+++ b/src/org/torproject/onionoo/Main.java
@@ -12,49 +12,87 @@ public class Main {
     printStatus("Updating internal node list.");
     CurrentNodes cn = new CurrentNodes();
     cn.readRelaySearchDataFile(new File("status/summary"));
+    printStatusTime("Read status/summary");
     cn.readRelayNetworkConsensuses();
+    printStatusTime("Read network status consensuses");
     cn.setRelayRunningBits();
+    printStatusTime("Set relay running bits");
     cn.lookUpCitiesAndASes();
+    printStatusTime("Looked up cities and ASes");
     cn.readBridgeNetworkStatuses();
+    printStatusTime("Read bridge network statuses");
     cn.setBridgeRunningBits();
+    printStatusTime("Set bridge running bits");
     cn.writeRelaySearchDataFile(new File("status/summary"), true);
+    printStatusTime("Wrote status/summary");
 
     printStatus("Updating detail data.");
     DetailDataWriter ddw = new DetailDataWriter();
     ddw.setCurrentRelays(cn.getCurrentRelays());
+    printStatusTime("Set current relays");
     ddw.setCurrentBridges(cn.getCurrentBridges());
+    printStatusTime("Set current bridges");
     ddw.startReverseDomainNameLookups();
+    printStatusTime("Started reverse domain name lookups");
     ddw.readRelayServerDescriptors();
+    printStatusTime("Read relay server descriptors");
     ddw.calculatePathSelectionProbabilities(cn.getLastBandwidthWeights());
+    printStatusTime("Calculated path selection probabilities");
     ddw.readExitLists();
+    printStatusTime("Read exit lists");
     ddw.readBridgeServerDescriptors();
+    printStatusTime("Read bridge server descriptors");
     ddw.readBridgePoolAssignments();
+    printStatusTime("Read bridge-pool assignments");
     ddw.finishReverseDomainNameLookups();
+    printStatusTime("Finished reverse domain name lookups");
     ddw.writeDetailDataFiles();
+    printStatusTime("Wrote detail data files");
 
     printStatus("Updating bandwidth data.");
     BandwidthDataWriter bdw = new BandwidthDataWriter();
     bdw.setCurrentRelays(cn.getCurrentRelays());
+    printStatusTime("Set current relays");
     bdw.setCurrentBridges(cn.getCurrentBridges());
+    printStatusTime("Set current bridges");
     bdw.readExtraInfoDescriptors();
+    printStatusTime("Read extra-info descriptors");
     bdw.deleteObsoleteBandwidthFiles();
+    printStatusTime("Deleted obsolete bandwidth files");
 
     printStatus("Updating weights data.");
     WeightsDataWriter wdw = new WeightsDataWriter();
     wdw.setCurrentRelays(cn.getCurrentRelays());
+    printStatusTime("Set current relays");
     wdw.readRelayServerDescriptors();
+    printStatusTime("Read relay server descriptors");
     wdw.readRelayNetworkConsensuses();
+    printStatusTime("Read relay network consensuses");
     wdw.writeWeightsDataFiles();
+    printStatusTime("Wrote weights data files");
     wdw.deleteObsoleteWeightsDataFiles();
+    printStatusTime("Deleted obsolete weights files");
 
     printStatus("Updating summary data.");
     cn.writeRelaySearchDataFile(new File("out/summary"), false);
+    printStatusTime("Wrote out/summary");
 
     printStatus("Terminating.");
   }
 
+  private static long printedLastStatusMessage =
+      System.currentTimeMillis();
+
   private static void printStatus(String message) {
     System.out.println(new Date() + ": " + message);
+    printedLastStatusMessage = System.currentTimeMillis();
+  }
+
+  private static void printStatusTime(String message) {
+    long now = System.currentTimeMillis();
+    System.out.println("  " + message + " ("
+        + (now - printedLastStatusMessage) + " millis).");
+    printedLastStatusMessage = now;
   }
 }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits