gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r14449 - gnunet/src/dht
Date: Thu, 17 Feb 2011 18:28:45 +0100

Author: nevans
Date: 2011-02-17 18:28:45 +0100 (Thu, 17 Feb 2011)
New Revision: 14449

Modified:
   gnunet/src/dht/gnunet-dht-driver.c
Log:
bigger floating point

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2011-02-17 16:57:48 UTC (rev 14448)
+++ gnunet/src/dht/gnunet-dht-driver.c  2011-02-17 17:28:45 UTC (rev 14449)
@@ -2604,10 +2604,10 @@
   unsigned long long total_duration;
   unsigned int new_connections;
   unsigned int new_failed_connections;
-  float conns_per_sec_recent;
-  float conns_per_sec_total;
-  float failed_conns_per_sec_recent;
-  float failed_conns_per_sec_total;
+  double conns_per_sec_recent;
+  double conns_per_sec_total;
+  double failed_conns_per_sec_recent;
+  double failed_conns_per_sec_total;
 
 #if ONLY_TESTING
   if (repeat_connect_mode == GNUNET_YES)
@@ -2631,8 +2631,6 @@
     }
 #endif
 
-
-
   if (GNUNET_TIME_absolute_get_difference (connect_last_time,
       GNUNET_TIME_absolute_get()).rel_value > 
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 
CONN_UPDATE_DURATION).rel_value)
     {
@@ -2648,10 +2646,10 @@
       total_duration = GNUNET_TIME_absolute_get_difference (connect_start_time,
                                                       
GNUNET_TIME_absolute_get()).rel_value / 1000;
 
-      failed_conns_per_sec_recent = (float)new_failed_connections / duration;
-      failed_conns_per_sec_total = (float)failed_connections / total_duration;
-      conns_per_sec_recent = (float)new_connections / duration;
-      conns_per_sec_total = (float)total_connections / total_duration;
+      failed_conns_per_sec_recent = (double)new_failed_connections / duration;
+      failed_conns_per_sec_total = (double)failed_connections / total_duration;
+      conns_per_sec_recent = (double)new_connections / duration;
+      conns_per_sec_total = (double)total_connections / total_duration;
       GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Recent: %.2f/s, Total: %.2f/s, 
Recent failed: %.2f/s, total failed %.2f/s\n",
                  conns_per_sec_recent, CONN_UPDATE_DURATION, 
conns_per_sec_total,
                  failed_conns_per_sec_recent, failed_conns_per_sec_total);
@@ -2677,6 +2675,11 @@
         }
 #endif
     }
+  else if (repeat_connect_mode == GNUNET_YES)
+    {
+      repeat_connect_task = 
GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS,
 60), &repeat_connect, NULL);
+    }
+
   if (emsg == NULL)
     {
       total_connections++;




reply via email to

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