gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r14921 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r14921 - gnunet/src/dht
Date: Thu, 7 Apr 2011 19:53:36 +0200

Author: nevans
Date: 2011-04-07 19:53:35 +0200 (Thu, 07 Apr 2011)
New Revision: 14921

Modified:
   gnunet/src/dht/gnunet-dht-driver.c
Log:
hostkeys timing

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2011-04-07 16:29:58 UTC (rev 14920)
+++ gnunet/src/dht/gnunet-dht-driver.c  2011-04-07 17:53:35 UTC (rev 14921)
@@ -426,6 +426,16 @@
 static struct GNUNET_TIME_Absolute connect_last_time;
 
 /**
+ * At what time did we start the hostkey creation process.
+ */
+static struct GNUNET_TIME_Absolute hostkey_start_time;
+
+/**
+ * At what time did we start the peer startup process.
+ */
+static struct GNUNET_TIME_Absolute peer_start_time;
+
+/**
  * Boolean value, should the driver issue find peer requests
  * (GNUNET_YES) or should it be left to the service (GNUNET_NO)
  */
@@ -3203,7 +3213,7 @@
                    expected_connections);
         }
 
-      if (expected_connections == GNUNET_SYSERR)
+      if (expected_connections == 0)
         {
           die_task
               = GNUNET_SCHEDULER_add_now (&end_badly,
@@ -3265,6 +3275,7 @@
 hostkey_callback(void *cls, const struct GNUNET_PeerIdentity *id,
     struct GNUNET_TESTING_Daemon *d, const char *emsg)
 {
+  char * revision_str;
   if (emsg != NULL)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -3283,6 +3294,15 @@
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                   "All %d hostkeys created, now creating topology!\n",
                   num_peers);
+
+      GNUNET_asprintf (&revision_str, "%llu", revision);
+      if (GNUNET_YES == insert_gauger_data)
+        GAUGER_ID("DHT_TESTING",
+                  "HOSTKEY_GENERATION",
+                  
GNUNET_TIME_absolute_get_duration(hostkey_start_time).rel_value / 
(double)num_peers,
+                  "ms/hostkey", revision_str);
+      GNUNET_free(revision_str);
+
       GNUNET_SCHEDULER_cancel (die_task);
       /* Set up task in case topology creation doesn't finish
        * within a reasonable amount of time */
@@ -3803,7 +3823,7 @@
                                                          "do_find_peer"))
     do_find_peer = GNUNET_YES;
 
-  if (GNUNET_NO == GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht",
+  if (GNUNET_NO == GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht_testing",
                                                            
"insert_gauger_data"))
     insert_gauger_data = GNUNET_YES;
 
@@ -4017,6 +4037,7 @@
 
   put_meter = create_meter (num_puts, "Puts completed ", GNUNET_YES);
   get_meter = create_meter (num_gets, "Gets completed ", GNUNET_YES);
+  hostkey_start_time = GNUNET_TIME_absolute_get();
   pg
       = GNUNET_TESTING_daemons_start (
                                       cfg,




reply via email to

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