gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27298 - gnunet/src/experimentation


From: gnunet
Subject: [GNUnet-SVN] r27298 - gnunet/src/experimentation
Date: Fri, 24 May 2013 16:44:20 +0200

Author: wachs
Date: 2013-05-24 16:44:20 +0200 (Fri, 24 May 2013)
New Revision: 27298

Modified:
   gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c
   gnunet/src/experimentation/test_experimentation_clique.c
   gnunet/src/experimentation/test_experimentation_clique.conf
Log:
extended test


Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c      
2013-05-24 14:28:03 UTC (rev 27297)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c      
2013-05-24 14:44:20 UTC (rev 27298)
@@ -199,9 +199,9 @@
                        GNUNET_free_non_null (e->description);
                        return;
        }
-       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Adding experiment `%s'\n"), 
e->name);
+       GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Adding experiment `%s'\n"), 
e->name);
        GNUNET_CONTAINER_multihashmap_put (experiments, &e->issuer.hashPubKey, 
e, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
-  GNUNET_STATISTICS_set (GSE_stats, "# expeeriments", 
GNUNET_CONTAINER_multihashmap_size (experiments), GNUNET_NO);
+  GNUNET_STATISTICS_set (GSE_stats, "# experiments", 
GNUNET_CONTAINER_multihashmap_size (experiments), GNUNET_NO);
 }
 
 /**

Modified: gnunet/src/experimentation/test_experimentation_clique.c
===================================================================
--- gnunet/src/experimentation/test_experimentation_clique.c    2013-05-24 
14:28:03 UTC (rev 27297)
+++ gnunet/src/experimentation/test_experimentation_clique.c    2013-05-24 
14:44:20 UTC (rev 27298)
@@ -35,6 +35,10 @@
  */
 #define NUM_PEERS 10
 
+#define NUM_ISSUER 1
+
+#define NUM_EXPERIMENTS 2
+
 #define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 
(5 * NUM_PEERS) + 20)
 
 /**
@@ -86,6 +90,7 @@
   unsigned int requested_nodes;
   unsigned int inactive_nodes;
   unsigned int issuer;
+  unsigned int experiments;
 };
 
 
@@ -156,28 +161,42 @@
 static void
 check_end ()
 {
-       static int last_value = 0;
+       static int last_active_value = 0;
+       static int last_issuer_value = 0;
+       static int last_experiments_value = 0;
   unsigned int peer;
   unsigned int total_active = 0;
   unsigned int total_inactive = 0;
   unsigned int total_requested = 0;
   unsigned int issuer = 0;
+  unsigned int experiments = 0;
 
        for (peer = 0; peer < NUM_PEERS; peer++)
        {
                        total_active += ph[peer].active_nodes;
                        total_requested += ph[peer].requested_nodes;
                        total_inactive += ph[peer].inactive_nodes;
-                       if (1 == ph[peer].issuer)
+                       if (NUM_ISSUER == ph[peer].issuer)
                                issuer ++;
+                       if (NUM_EXPERIMENTS == ph[peer].experiments)
+                               experiments ++;
+       }
+       if ((last_issuer_value < issuer) && (issuer == NUM_PEERS))
+               fprintf (stderr, "I");
+       last_issuer_value = issuer;
 
-       }
-       if (last_value < total_active)
+       if ((last_experiments_value < experiments) && (experiments == 
NUM_PEERS))
+               fprintf (stderr, "E");
+       last_experiments_value = experiments;
+
+       if (last_active_value < total_active)
                fprintf (stderr, ".");
+       last_active_value = total_active;
 
+
        if ((total_active == (NUM_PEERS * (NUM_PEERS -1))) &&
                 (total_requested == 0) && (total_inactive == 0) &&
-                (issuer == NUM_PEERS))
+                (issuer == NUM_PEERS) && (experiments == NUM_PEERS))
        {
                        fprintf (stderr, "\n");
                        GNUNET_log (GNUNET_ERROR_TYPE_INFO, "All %u peers 
active in a clique\n", NUM_PEERS);
@@ -219,6 +238,10 @@
        {
                        peer->issuer = value;
        }
+       if (0 == strcmp (name, "# experiments"))
+       {
+                       peer->experiments = value;
+       }
 
        check_end ();
 
@@ -260,6 +283,9 @@
   GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
                 (sh, "experimentation", "# issuer",
                  stat_iterator, peer));
+  GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
+                (sh, "experimentation", "# experiments",
+                 stat_iterator, peer));
 }
 
 /**
@@ -303,6 +329,12 @@
   GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
                 (peer->sh, "experimentation", "# nodes requested",
                  stat_iterator, peer));
+  GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
+                (peer->sh, "experimentation", "# issuer",
+                 stat_iterator, peer));
+  GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
+                (peer->sh, "experimentation", "# experiments",
+                 stat_iterator, peer));
   GNUNET_STATISTICS_destroy (op_result, GNUNET_NO);
   peer->sh = NULL;
 }

Modified: gnunet/src/experimentation/test_experimentation_clique.conf
===================================================================
--- gnunet/src/experimentation/test_experimentation_clique.conf 2013-05-24 
14:28:03 UTC (rev 27297)
+++ gnunet/src/experimentation/test_experimentation_clique.conf 2013-05-24 
14:44:20 UTC (rev 27298)
@@ -38,6 +38,7 @@
 [experimentation]
 #PREFIX = valgrind --leak-check=full
 ISSUERS = 
TFRM29O2RQNKLVBQIGODJ6GD58LSQ2NM9TNFBC6N48BRJHQO38Q73N2OM3V4CLKDM6CILQV4CU8PMJDRG0FNB0PDI057DBRANMLPLRG
+EXPERIMENTS = test_experiments.exp
 
 [ats]
 WAN_QUOTA_OUT = 3932160




reply via email to

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