diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-22 12:15:15 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-22 12:15:15 +0000 |
commit | 3425604d4fa20375309ec016a6f52f5e57578fac (patch) | |
tree | 0c255c3ce2e21ae745c330e62863b76a60564f8a /src/ats-tests/perf_ats.c | |
parent | 67bb119f1cf91644a45d53ccb9e6eb6a11ca0598 (diff) | |
download | gnunet-3425604d4fa20375309ec016a6f52f5e57578fac.tar.gz gnunet-3425604d4fa20375309ec016a6f52f5e57578fac.zip |
fix for evaluation
Diffstat (limited to 'src/ats-tests/perf_ats.c')
-rw-r--r-- | src/ats-tests/perf_ats.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c index 53533a82a..9d56ab659 100644 --- a/src/ats-tests/perf_ats.c +++ b/src/ats-tests/perf_ats.c | |||
@@ -150,6 +150,9 @@ evaluate () | |||
150 | { | 150 | { |
151 | p = &mp->partners[c_s]; | 151 | p = &mp->partners[c_s]; |
152 | 152 | ||
153 | fprintf (stderr , "%u %u %u\n", p->bytes_sent, (p->bytes_sent / 1024) / duration, duration); | ||
154 | fprintf (stderr , "%u %u %u \n", p->bytes_received, (p->bytes_sent / 1024) / duration, duration); | ||
155 | |||
153 | kb_sent_sec = 0; | 156 | kb_sent_sec = 0; |
154 | kb_recv_sec = 0; | 157 | kb_recv_sec = 0; |
155 | kb_sent_percent = 0.0; | 158 | kb_sent_percent = 0.0; |
@@ -158,15 +161,19 @@ evaluate () | |||
158 | 161 | ||
159 | if (duration > 0) | 162 | if (duration > 0) |
160 | { | 163 | { |
161 | kb_sent_percent = (p->bytes_sent / 1024) / duration; | 164 | kb_sent_sec = (p->bytes_sent / 1024) / duration; |
162 | kb_recv_percent = (p->bytes_received / 1024) / duration; | 165 | kb_recv_sec = (p->bytes_received / 1024) / duration; |
163 | } | 166 | } |
167 | |||
164 | if (mp->total_bytes_sent > 0) | 168 | if (mp->total_bytes_sent > 0) |
165 | kb_sent_percent = ((double) p->bytes_sent * 100) / mp->total_bytes_sent; | 169 | kb_sent_percent = ((double) p->bytes_sent * 100) / mp->total_bytes_sent; |
166 | if (mp->total_bytes_received > 0) | 170 | if (mp->total_bytes_received > 0) |
167 | kb_recv_percent = ((double) p->bytes_received * 100) / mp->total_bytes_received; | 171 | kb_recv_percent = ((double) p->bytes_received * 100) / mp->total_bytes_received; |
168 | if (1000 * p->messages_sent > 0) | 172 | if (1000 * p->messages_sent > 0) |
169 | rtt = p->total_app_rtt / (1000 * p->messages_sent); | 173 | rtt = p->total_app_rtt / (1000 * p->messages_sent); |
174 | |||
175 | |||
176 | |||
170 | fprintf (stderr, | 177 | fprintf (stderr, |
171 | "%c Master [%u] -> Slave [%u]: sent %u KiB/s (%.2f %%), received %u KiB/s (%.2f %%)\n", | 178 | "%c Master [%u] -> Slave [%u]: sent %u KiB/s (%.2f %%), received %u KiB/s (%.2f %%)\n", |
172 | (mp->pref_partner == p->dest) ? '*' : ' ', | 179 | (mp->pref_partner == p->dest) ? '*' : ' ', |
@@ -232,7 +239,7 @@ comm_send_ready (void *cls, size_t size, void *buf) | |||
232 | return 0; | 239 | return 0; |
233 | } | 240 | } |
234 | 241 | ||
235 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Master [%u]: Sending PING to [%u]\n", | 242 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Master [%u]: Sending PING to [%u]\n", |
236 | p->me->no, p->dest->no); | 243 | p->me->no, p->dest->no); |
237 | 244 | ||
238 | p->messages_sent++; | 245 | p->messages_sent++; |
@@ -391,7 +398,7 @@ comm_handle_ping (void *cls, const struct GNUNET_PeerIdentity *other, | |||
391 | return GNUNET_SYSERR; | 398 | return GNUNET_SYSERR; |
392 | } | 399 | } |
393 | 400 | ||
394 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, | 401 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
395 | "Slave [%u]: Received PING from [%u], sending PONG\n", me->no, | 402 | "Slave [%u]: Received PING from [%u], sending PONG\n", me->no, |
396 | p->dest->no); | 403 | p->dest->no); |
397 | 404 | ||
@@ -430,7 +437,7 @@ comm_handle_pong (void *cls, const struct GNUNET_PeerIdentity *other, | |||
430 | return GNUNET_SYSERR; | 437 | return GNUNET_SYSERR; |
431 | } | 438 | } |
432 | 439 | ||
433 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, | 440 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
434 | "Master [%u]: Received PONG from [%u], next message\n", me->no, | 441 | "Master [%u]: Received PONG from [%u], next message\n", me->no, |
435 | p->dest->no); | 442 | p->dest->no); |
436 | 443 | ||