- Gather more stats from nse runs
authorBart Polot <bart@net.in.tum.de>
Mon, 12 Dec 2011 17:29:09 +0000 (17:29 +0000)
committerBart Polot <bart@net.in.tum.de>
Mon, 12 Dec 2011 17:29:09 +0000 (17:29 +0000)
src/nse/gnunet-nse-profiler.c
src/nse/nse_profiler_test.conf

index d3ff044c2e7e48ab319784bcc2f32407b3272589..988e6e15abeb413fcfd43cfc55f888f2261c226b 100644 (file)
@@ -49,7 +49,14 @@ struct NSEPeer
 
 struct StatsContext
 {
-  unsigned long long total_nse_messages;
+  /**
+   * How many messages have peers received during the test.
+   */
+  unsigned long long total_nse_received_messages;
+  /**
+   * How many messages have peers send during the test (should be == received).
+   */
+  unsigned long long total_nse_sent_messages;
 };
 
 
@@ -390,8 +397,17 @@ stats_finished_callback (void *cls, int success)
     /* Stats lookup successful, write out data */
     buf = NULL;
     buf_len =
-        GNUNET_asprintf (&buf, "TOTAL_NSE_MESSAGES: %u\n",
-                         stats_context->total_nse_messages);
+        GNUNET_asprintf (&buf, "TOTAL_NSE_RECEIVED_MESSAGES: %u\n",
+                         stats_context->total_nse_received_messages);
+    if (buf_len > 0)
+    {
+      GNUNET_DISK_file_write (data_file, buf, buf_len);
+    }
+    GNUNET_free_non_null (buf);
+    buf = NULL;
+    buf_len =
+        GNUNET_asprintf (&buf, "TOTAL_NSE_SENT_MESSAGES: %u\n",
+                         stats_context->total_nse_sent_messages);
     if (buf_len > 0)
     {
       GNUNET_DISK_file_write (data_file, buf, buf_len);
@@ -423,26 +439,48 @@ statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer,
 {
   struct StatsContext *stats_context = cls;
 
-  if ((0 == strcmp (subsystem, "nse")) &&
-      (0 == strcmp (name, "# flood messages received")))
+  if (0 == strcmp (subsystem, "nse"))
   {
-    stats_context->total_nse_messages += value;
-#if VERBOSE
-    if (data_file != NULL)
+    if (0 == strcmp (name, "# flood messages received"))
     {
-      char *buf;
-      int buf_len;
-
-      buf = NULL;
-      buf_len =
-          GNUNET_asprintf (&buf, "Peer %s: %u\n", GNUNET_i2s(peer), value);
-      if (buf_len > 0)
+      stats_context->total_nse_received_messages += value;
+#if VERBOSE
+      if (data_file != NULL)
       {
-        GNUNET_DISK_file_write (data_file, buf, buf_len);
+        char *buf;
+        int buf_len;
+
+        buf = NULL;
+        buf_len =
+            GNUNET_asprintf (&buf, "%s %u RECEIVED\n", GNUNET_i2s(peer), value);
+        if (buf_len > 0)
+        {
+          GNUNET_DISK_file_write (data_file, buf, buf_len);
+        }
+        GNUNET_free_non_null (buf);
       }
-      GNUNET_free_non_null (buf);
+#endif
     }
+    if (0 == strcmp (name, "# flood messages sent"))
+    {
+      stats_context->total_nse_sent_messages += value;
+#if VERBOSE
+      if (data_file != NULL)
+      {
+        char *buf;
+        int buf_len;
+
+        buf = NULL;
+        buf_len =
+            GNUNET_asprintf (&buf, "%s %u SENT\n", GNUNET_i2s(peer), value);
+        if (buf_len > 0)
+        {
+          GNUNET_DISK_file_write (data_file, buf, buf_len);
+        }
+        GNUNET_free_non_null (buf);
+      }
 #endif
+    }
   }
   return GNUNET_OK;
 }
index 6a6580221621f785fee80653558fa17a5f8b7817..54df2238bb6d6cf5503e80a8f43133f780c80efd 100644 (file)
@@ -1,5 +1,5 @@
 [PATHS]
-SERVICEHOME = /tmp/nse-profiler/
+SERVICEHOME = /tmp/nse-profiler2/
 DEFAULTCONFIG = nse_profiler_test.conf
 
 [nse]
@@ -138,18 +138,43 @@ MAX_OUTSTANDING_CONNECTIONS = 200
 #NUM_PEERINFO_PER_HOST = 10
 #SINGLE_STATISTICS_PER_HOST = YES
 #NUM_STATISTICS_PER_HOST = 10
-DELETE_FILES = NO
+DELETE_FILES = YES
 
 [nse-profiler]
 OUTPUT_FILE = nse_output_4000_peers.dat
 TOPOLOGY_OUTPUT_FILE = nse_topo_4000_peers
 DATA_OUTPUT_FILE = nse_topo_4000_peers_stats
-#ROUND0 = 90
-#ROUND1 = 100
-#ROUND2 = 50
-#ROUND3 = 100
-#ROUND2 = 500
-#ROUND3 = 1000
-WAIT_TIME = 19200 s
+ROUND0 = 4000
+ROUND1 = 4000
+ROUND2 = 4000
+ROUND3 = 4000
+ROUND4 = 4000
+ROUND5 = 4000
+ROUND6 = 4000
+ROUND7 = 4000
+ROUND8 = 4000
+ROUND9 = 4000
+ROUND10 = 4000
+ROUND11 = 1000
+ROUND12 = 1000
+ROUND13 = 1000
+ROUND14 = 1000
+ROUND15 = 1000
+ROUND16 = 1000
+ROUND17 = 1000
+ROUND18 = 1000
+ROUND19 = 1000
+ROUND20 = 1000
+ROUND21 = 2000
+ROUND22 = 2000
+ROUND23 = 2000
+ROUND24 = 2000
+ROUND25 = 2000
+ROUND26 = 2000
+ROUND27 = 2000
+ROUND28 = 2000
+ROUND29 = 2000
+ROUND30 = 2000
+WAIT_TIME = 1920 s
 CONNECTION_LIMIT = 10