gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29447 - gnunet/src/ats-tests


From: gnunet
Subject: [GNUnet-SVN] r29447 - gnunet/src/ats-tests
Date: Fri, 20 Sep 2013 18:50:45 +0200

Author: wachs
Date: 2013-09-20 18:50:45 +0200 (Fri, 20 Sep 2013)
New Revision: 29447

Modified:
   gnunet/src/ats-tests/perf_ats_logging.c
Log:
soem logging improvements


Modified: gnunet/src/ats-tests/perf_ats_logging.c
===================================================================
--- gnunet/src/ats-tests/perf_ats_logging.c     2013-09-20 16:41:16 UTC (rev 
29446)
+++ gnunet/src/ats-tests/perf_ats_logging.c     2013-09-20 16:50:45 UTC (rev 
29447)
@@ -326,6 +326,8 @@
   unsigned int throughput_send;
   unsigned int throughput_recv_slave;
   unsigned int throughput_send_slave;
+  int last_throughput_send;
+  int last_throughput_recv;
   double mult;
 
   for (c_m = 0; c_m < num_peers; c_m++)
@@ -343,6 +345,8 @@
       return;
     }
 
+    last_throughput_recv = 0;
+    last_throughput_send = 0;
 
     for (cur_lt = lp[c_m].head; NULL != cur_lt; cur_lt = cur_lt->next)
     {
@@ -357,16 +361,39 @@
       mult = (1.0 * 1000 * 1000) / (delta.rel_value_us);
       if (NULL != cur_lt->prev)
       {
-        throughput_send = cur_lt->total_bytes_sent - 
cur_lt->prev->total_bytes_sent;
-        throughput_recv = cur_lt->total_bytes_received - 
cur_lt->prev->total_bytes_received;
+        if (cur_lt->total_bytes_sent - cur_lt->prev->total_bytes_sent > 0)
+        {
+          throughput_send = cur_lt->total_bytes_sent - 
cur_lt->prev->total_bytes_sent;
+          throughput_send *= mult;
+        }
+        else
+        {
+          //GNUNET_break (0);
+          throughput_send = last_throughput_send; /* no msgs received */
+        }
+
+        if (cur_lt->total_bytes_received - cur_lt->prev->total_bytes_received 
> 0)
+        {
+          throughput_recv = cur_lt->total_bytes_received - 
cur_lt->prev->total_bytes_received;
+          throughput_recv *= mult;
+        }
+        else
+        {
+         // GNUNET_break (0);
+          throughput_recv = last_throughput_recv; /* no msgs received */
+        }
       }
       else
       {
         throughput_send = cur_lt->total_bytes_sent;
         throughput_recv = cur_lt->total_bytes_received;
+
+        throughput_send *= mult;
+        throughput_recv *= mult;
+
       }
-      throughput_send *= mult;
-      throughput_recv *= mult;
+      last_throughput_send = throughput_send;
+      last_throughput_recv = throughput_recv;
 
 
       GNUNET_log(GNUNET_ERROR_TYPE_INFO,
@@ -510,7 +537,7 @@
           app_rtt = (slt->total_app_rtt - prev_log_slt->total_app_rtt) /
                   (slt->total_messages_sent - 
prev_log_slt->total_messages_sent);
         else
-          app_rtt = 0;
+          app_rtt = prev_log_slt->app_rtt; /* No messages were */
       }
       slt->app_rtt = app_rtt;
       GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,




reply via email to

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