gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r32756 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r32756 - gnunet/src/mesh
Date: Sat, 22 Mar 2014 03:58:22 +0100

Author: bartpolot
Date: 2014-03-22 03:58:22 +0100 (Sat, 22 Mar 2014)
New Revision: 32756

Modified:
   gnunet/src/mesh/gnunet-mesh-profiler.c
Log:
- start test only after warmup

Modified: gnunet/src/mesh/gnunet-mesh-profiler.c
===================================================================
--- gnunet/src/mesh/gnunet-mesh-profiler.c      2014-03-22 02:58:20 UTC (rev 
32755)
+++ gnunet/src/mesh/gnunet-mesh-profiler.c      2014-03-22 02:58:22 UTC (rev 
32756)
@@ -233,6 +233,11 @@
 static int do_warmup;
 
 /**
+ * Warmup progress.
+ */
+static unsigned int peers_warmup;
+
+/**
  * Flag to notify callbacks not to generate any new traffic anymore.
  */
 static int test_finished;
@@ -776,6 +781,11 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "WARMUP %u <= %u\n",
                 n, get_index (peer), channel);
+    peers_warmup++;
+    if (peers_warmup < peers_total)
+      return NULL;
+    test_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+                                              &start_test, NULL);
     return NULL;
   }
   GNUNET_assert (peer == peers[n].incoming);
@@ -923,7 +933,6 @@
        const char *emsg)
 {
   long n = (long) cls;
-  struct GNUNET_TIME_Relative delay;
 
   if (NULL == pinfo || NULL != emsg)
   {
@@ -946,10 +955,12 @@
     return;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got all IDs, starting profiler\n");
   if (do_warmup)
+  {
     warmup();
-  delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
-                                         150 * peers_total);
-  test_task = GNUNET_SCHEDULER_add_delayed (delay, &start_test, NULL);
+    return; /* start_test from incoming_channel */
+  }
+  test_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+                                            &start_test, NULL);
 }
 
 /**




reply via email to

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