aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tests/perf_ats.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-09-20 07:45:12 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-09-20 07:45:12 +0000
commitc0ed97f579f033d16fcfacf3db63dcd1377c66c3 (patch)
tree2e79655c584e040de2774d1f7bd7ee83378f3f8c /src/ats-tests/perf_ats.c
parentf6ff4c48d5d41875e03b59df33117cb4ba943877 (diff)
downloadgnunet-c0ed97f579f033d16fcfacf3db63dcd1377c66c3.tar.gz
gnunet-c0ed97f579f033d16fcfacf3db63dcd1377c66c3.zip
measuring application layer delay
Diffstat (limited to 'src/ats-tests/perf_ats.c')
-rw-r--r--src/ats-tests/perf_ats.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c
index 6198d1464..a3b4b2652 100644
--- a/src/ats-tests/perf_ats.c
+++ b/src/ats-tests/perf_ats.c
@@ -167,6 +167,7 @@ evaluate ()
167 int c_s; 167 int c_s;
168 unsigned int duration; 168 unsigned int duration;
169 struct BenchmarkPeer *mp; 169 struct BenchmarkPeer *mp;
170 struct BenchmarkPartner *p;
170 171
171 duration = (perf_duration.rel_value_us / (1000 * 1000)); 172 duration = (perf_duration.rel_value_us / (1000 * 1000));
172 for (c_m = 0; c_m < num_masters; c_m++) 173 for (c_m = 0; c_m < num_masters; c_m++)
@@ -181,14 +182,20 @@ evaluate ()
181 182
182 for (c_s = 0; c_s < num_slaves; c_s++) 183 for (c_s = 0; c_s < num_slaves; c_s++)
183 { 184 {
185 p = &mp->partners[c_s];
184 fprintf (stderr, 186 fprintf (stderr,
185 "%c Master [%u] -> Slave [%u]: sent %u KiB/s (%.2f \%), received %u KiB/s (%.2f \%)\n", 187 "%c Master [%u] -> Slave [%u]: sent %u KiB/s (%.2f \%), received %u KiB/s (%.2f \%)\n",
186 (mp->pref_partner == mp->partners[c_s].dest) ? '*' : ' ', 188 (mp->pref_partner == p->dest) ? '*' : ' ',
187 mp->no, mp->partners[c_s].dest->no, 189 mp->no, p->dest->no,
188 (mp->partners[c_s].bytes_sent / 1024) / duration, 190 (p->bytes_sent / 1024) / duration,
189 ((double) mp->partners[c_s].bytes_sent * 100) / mp->total_bytes_sent, 191 ((double) p->bytes_sent * 100) / mp->total_bytes_sent,
190 (mp->partners[c_s].bytes_received / 1024) / duration, 192 (p->bytes_received / 1024) / duration,
191 ((double) mp->partners[c_s].bytes_received * 100) / mp->total_bytes_received ); 193 ((double) p->bytes_received * 100) / mp->total_bytes_received );
194 fprintf (stderr,
195 "%c Master [%u] -> Slave [%u]: Average application layer RTT: %u ms\n",
196 (mp->pref_partner == p->dest) ? '*' : ' ',
197 mp->no, p->dest->no,
198 p->total_app_delay / (1000 * p->messages_sent));
192 } 199 }
193 } 200 }
194} 201}
@@ -402,6 +409,7 @@ comm_send_ready (void *cls, size_t size, void *buf)
402static void 409static void
403comm_schedule_send (struct BenchmarkPartner *p) 410comm_schedule_send (struct BenchmarkPartner *p)
404{ 411{
412 p->last_message_sent = GNUNET_TIME_absolute_get();
405 if (GNUNET_YES == test_core) 413 if (GNUNET_YES == test_core)
406 { 414 {
407 p->cth = GNUNET_CORE_notify_transmit_ready ( 415 p->cth = GNUNET_CORE_notify_transmit_ready (
@@ -748,6 +756,7 @@ comm_handle_pong (void *cls, const struct GNUNET_PeerIdentity *other,
748 return GNUNET_SYSERR; 756 return GNUNET_SYSERR;
749 } 757 }
750 758
759
751 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 760 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
752 "Master [%u]: Received PONG from [%u], next message\n", me->no, 761 "Master [%u]: Received PONG from [%u], next message\n", me->no,
753 p->dest->no); 762 p->dest->no);
@@ -756,6 +765,8 @@ comm_handle_pong (void *cls, const struct GNUNET_PeerIdentity *other,
756 p->bytes_received += TEST_MESSAGE_SIZE; 765 p->bytes_received += TEST_MESSAGE_SIZE;
757 p->me->total_messages_received++; 766 p->me->total_messages_received++;
758 p->me->total_bytes_received += TEST_MESSAGE_SIZE; 767 p->me->total_bytes_received += TEST_MESSAGE_SIZE;
768 p->total_app_delay += GNUNET_TIME_absolute_get_difference(p->last_message_sent,
769 GNUNET_TIME_absolute_get()).rel_value_us;
759 770
760 comm_schedule_send (p); 771 comm_schedule_send (p);
761 return GNUNET_OK; 772 return GNUNET_OK;