[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29424 - gnunet/src/ats-tests
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29424 - gnunet/src/ats-tests |
Date: |
Fri, 20 Sep 2013 09:45:12 +0200 |
Author: wachs
Date: 2013-09-20 09:45:12 +0200 (Fri, 20 Sep 2013)
New Revision: 29424
Modified:
gnunet/src/ats-tests/perf_ats.c
gnunet/src/ats-tests/perf_ats.h
Log:
measuring application layer delay
Modified: gnunet/src/ats-tests/perf_ats.c
===================================================================
--- gnunet/src/ats-tests/perf_ats.c 2013-09-20 07:24:41 UTC (rev 29423)
+++ gnunet/src/ats-tests/perf_ats.c 2013-09-20 07:45:12 UTC (rev 29424)
@@ -167,6 +167,7 @@
int c_s;
unsigned int duration;
struct BenchmarkPeer *mp;
+ struct BenchmarkPartner *p;
duration = (perf_duration.rel_value_us / (1000 * 1000));
for (c_m = 0; c_m < num_masters; c_m++)
@@ -181,14 +182,20 @@
for (c_s = 0; c_s < num_slaves; c_s++)
{
+ p = &mp->partners[c_s];
fprintf (stderr,
"%c Master [%u] -> Slave [%u]: sent %u KiB/s (%.2f \%), received %u
KiB/s (%.2f \%)\n",
- (mp->pref_partner == mp->partners[c_s].dest) ? '*' : ' ',
- mp->no, mp->partners[c_s].dest->no,
- (mp->partners[c_s].bytes_sent / 1024) / duration,
- ((double) mp->partners[c_s].bytes_sent * 100) / mp->total_bytes_sent,
- (mp->partners[c_s].bytes_received / 1024) / duration,
- ((double) mp->partners[c_s].bytes_received * 100) /
mp->total_bytes_received );
+ (mp->pref_partner == p->dest) ? '*' : ' ',
+ mp->no, p->dest->no,
+ (p->bytes_sent / 1024) / duration,
+ ((double) p->bytes_sent * 100) / mp->total_bytes_sent,
+ (p->bytes_received / 1024) / duration,
+ ((double) p->bytes_received * 100) / mp->total_bytes_received );
+ fprintf (stderr,
+ "%c Master [%u] -> Slave [%u]: Average application layer RTT: %u
ms\n",
+ (mp->pref_partner == p->dest) ? '*' : ' ',
+ mp->no, p->dest->no,
+ p->total_app_delay / (1000 * p->messages_sent));
}
}
}
@@ -402,6 +409,7 @@
static void
comm_schedule_send (struct BenchmarkPartner *p)
{
+ p->last_message_sent = GNUNET_TIME_absolute_get();
if (GNUNET_YES == test_core)
{
p->cth = GNUNET_CORE_notify_transmit_ready (
@@ -748,6 +756,7 @@
return GNUNET_SYSERR;
}
+
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
"Master [%u]: Received PONG from [%u], next message\n", me->no,
p->dest->no);
@@ -756,6 +765,8 @@
p->bytes_received += TEST_MESSAGE_SIZE;
p->me->total_messages_received++;
p->me->total_bytes_received += TEST_MESSAGE_SIZE;
+ p->total_app_delay +=
GNUNET_TIME_absolute_get_difference(p->last_message_sent,
+ GNUNET_TIME_absolute_get()).rel_value_us;
comm_schedule_send (p);
return GNUNET_OK;
Modified: gnunet/src/ats-tests/perf_ats.h
===================================================================
--- gnunet/src/ats-tests/perf_ats.h 2013-09-20 07:24:41 UTC (rev 29423)
+++ gnunet/src/ats-tests/perf_ats.h 2013-09-20 07:45:12 UTC (rev 29424)
@@ -71,6 +71,16 @@
struct GNUNET_TRANSPORT_TransmitHandle *tth;
/**
+ * Timestamp to calculate communication layer delay
+ */
+ struct GNUNET_TIME_Absolute last_message_sent;
+
+ /**
+ * Accumulated delay for all messages
+ */
+ unsigned int total_app_delay;
+
+ /**
* Number of messages sent to this partner
*/
unsigned int messages_sent;
@@ -89,6 +99,10 @@
* Number of bytes received from this partner
*/
unsigned int bytes_received;
+
+
+
+
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29424 - gnunet/src/ats-tests,
gnunet <=