gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r18564 - gnunet/src/nse


From: gnunet
Subject: [GNUnet-SVN] r18564 - gnunet/src/nse
Date: Mon, 12 Dec 2011 18:29:09 +0100

Author: bartpolot
Date: 2011-12-12 18:29:09 +0100 (Mon, 12 Dec 2011)
New Revision: 18564

Modified:
   gnunet/src/nse/gnunet-nse-profiler.c
   gnunet/src/nse/nse_profiler_test.conf
Log:
- Gather more stats from nse runs

Modified: gnunet/src/nse/gnunet-nse-profiler.c
===================================================================
--- gnunet/src/nse/gnunet-nse-profiler.c        2011-12-12 17:20:02 UTC (rev 
18563)
+++ gnunet/src/nse/gnunet-nse-profiler.c        2011-12-12 17:29:09 UTC (rev 
18564)
@@ -49,7 +49,14 @@
 
 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,13 +397,22 @@
     /* 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);
+    }
+    GNUNET_free_non_null (buf);
   }
 
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == shutdown_handle);
@@ -423,26 +439,48 @@
 {
   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 (0 == strcmp (name, "# flood messages received"))
+    {
+      stats_context->total_nse_received_messages += value;
 #if VERBOSE
-    if (data_file != NULL)
+      if (data_file != NULL)
+      {
+        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);
+      }
+#endif
+    }
+    if (0 == strcmp (name, "# flood messages sent"))
     {
-      char *buf;
-      int buf_len;
+      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, "Peer %s: %u\n", GNUNET_i2s(peer), value);
-      if (buf_len > 0)
-      {
-        GNUNET_DISK_file_write (data_file, buf, 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);
       }
-      GNUNET_free_non_null (buf);
+#endif
     }
-#endif
   }
   return GNUNET_OK;
 }

Modified: gnunet/src/nse/nse_profiler_test.conf
===================================================================
--- gnunet/src/nse/nse_profiler_test.conf       2011-12-12 17:20:02 UTC (rev 
18563)
+++ gnunet/src/nse/nse_profiler_test.conf       2011-12-12 17:29:09 UTC (rev 
18564)
@@ -1,5 +1,5 @@
 [PATHS]
-SERVICEHOME = /tmp/nse-profiler/
+SERVICEHOME = /tmp/nse-profiler2/
 DEFAULTCONFIG = nse_profiler_test.conf
 
 [nse]
@@ -138,18 +138,43 @@
 #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
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]