]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add packaged cell fullness to the heartbeat message.
authorNick Mathewson <nickm@torproject.org>
Tue, 18 Dec 2012 20:16:35 +0000 (15:16 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 Dec 2012 20:16:35 +0000 (15:16 -0500)
This is an attempt to diagnose the severity of bug 7743.

changes/hb-fullness [new file with mode: 0644]
src/or/status.c

diff --git a/changes/hb-fullness b/changes/hb-fullness
new file mode 100644 (file)
index 0000000..5a8beb8
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor features:
+    - Log packaged cell fullness as part of the heartbeat message.
+      Diagnosis to try to determine the extent of bug 7743.
index fc01d0a242eca019478f47f6195d6805d32fce96..1a4e568854456c223cfc1b167d518ab6a90b0fa6 100644 (file)
@@ -10,6 +10,7 @@
 #include "config.h"
 #include "status.h"
 #include "nodelist.h"
+#include "relay.h"
 #include "router.h"
 #include "circuitlist.h"
 #include "main.h"
@@ -106,6 +107,11 @@ log_heartbeat(time_t now)
          "circuits open. I've sent %s and received %s.",
          uptime, count_circuits(),bw_sent,bw_rcvd);
 
+  if (stats_n_data_cells_packaged)
+    log(LOG_NOTICE, LD_HEARTBEAT, "Average packaged cell fullness: %2.3f%%",
+        100*(U64_TO_DBL(stats_n_data_bytes_packaged) /
+             U64_TO_DBL(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
+
   tor_free(uptime);
   tor_free(bw_sent);
   tor_free(bw_rcvd);