diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-20 16:50:45 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-20 16:50:45 +0000 |
commit | 9db84f729ed3dc14c49dc38ec9ba4bbcade14054 (patch) | |
tree | c61814d762120ede242b9c6d12029be5690b4bf3 /src/ats-tests/perf_ats_logging.c | |
parent | 863e2904baf1c0a64360d9890edfe5b35d72a979 (diff) | |
download | gnunet-9db84f729ed3dc14c49dc38ec9ba4bbcade14054.tar.gz gnunet-9db84f729ed3dc14c49dc38ec9ba4bbcade14054.zip |
soem logging improvements
Diffstat (limited to 'src/ats-tests/perf_ats_logging.c')
-rw-r--r-- | src/ats-tests/perf_ats_logging.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/ats-tests/perf_ats_logging.c b/src/ats-tests/perf_ats_logging.c index 54e9f7fd9..643f55243 100644 --- a/src/ats-tests/perf_ats_logging.c +++ b/src/ats-tests/perf_ats_logging.c | |||
@@ -326,6 +326,8 @@ write_to_file () | |||
326 | unsigned int throughput_send; | 326 | unsigned int throughput_send; |
327 | unsigned int throughput_recv_slave; | 327 | unsigned int throughput_recv_slave; |
328 | unsigned int throughput_send_slave; | 328 | unsigned int throughput_send_slave; |
329 | int last_throughput_send; | ||
330 | int last_throughput_recv; | ||
329 | double mult; | 331 | double mult; |
330 | 332 | ||
331 | for (c_m = 0; c_m < num_peers; c_m++) | 333 | for (c_m = 0; c_m < num_peers; c_m++) |
@@ -343,6 +345,8 @@ write_to_file () | |||
343 | return; | 345 | return; |
344 | } | 346 | } |
345 | 347 | ||
348 | last_throughput_recv = 0; | ||
349 | last_throughput_send = 0; | ||
346 | 350 | ||
347 | for (cur_lt = lp[c_m].head; NULL != cur_lt; cur_lt = cur_lt->next) | 351 | for (cur_lt = lp[c_m].head; NULL != cur_lt; cur_lt = cur_lt->next) |
348 | { | 352 | { |
@@ -357,16 +361,39 @@ write_to_file () | |||
357 | mult = (1.0 * 1000 * 1000) / (delta.rel_value_us); | 361 | mult = (1.0 * 1000 * 1000) / (delta.rel_value_us); |
358 | if (NULL != cur_lt->prev) | 362 | if (NULL != cur_lt->prev) |
359 | { | 363 | { |
360 | throughput_send = cur_lt->total_bytes_sent - cur_lt->prev->total_bytes_sent; | 364 | if (cur_lt->total_bytes_sent - cur_lt->prev->total_bytes_sent > 0) |
361 | throughput_recv = cur_lt->total_bytes_received - cur_lt->prev->total_bytes_received; | 365 | { |
366 | throughput_send = cur_lt->total_bytes_sent - cur_lt->prev->total_bytes_sent; | ||
367 | throughput_send *= mult; | ||
368 | } | ||
369 | else | ||
370 | { | ||
371 | //GNUNET_break (0); | ||
372 | throughput_send = last_throughput_send; /* no msgs received */ | ||
373 | } | ||
374 | |||
375 | if (cur_lt->total_bytes_received - cur_lt->prev->total_bytes_received > 0) | ||
376 | { | ||
377 | throughput_recv = cur_lt->total_bytes_received - cur_lt->prev->total_bytes_received; | ||
378 | throughput_recv *= mult; | ||
379 | } | ||
380 | else | ||
381 | { | ||
382 | // GNUNET_break (0); | ||
383 | throughput_recv = last_throughput_recv; /* no msgs received */ | ||
384 | } | ||
362 | } | 385 | } |
363 | else | 386 | else |
364 | { | 387 | { |
365 | throughput_send = cur_lt->total_bytes_sent; | 388 | throughput_send = cur_lt->total_bytes_sent; |
366 | throughput_recv = cur_lt->total_bytes_received; | 389 | throughput_recv = cur_lt->total_bytes_received; |
390 | |||
391 | throughput_send *= mult; | ||
392 | throughput_recv *= mult; | ||
393 | |||
367 | } | 394 | } |
368 | throughput_send *= mult; | 395 | last_throughput_send = throughput_send; |
369 | throughput_recv *= mult; | 396 | last_throughput_recv = throughput_recv; |
370 | 397 | ||
371 | 398 | ||
372 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 399 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
@@ -510,7 +537,7 @@ collect_log_now (void) | |||
510 | app_rtt = (slt->total_app_rtt - prev_log_slt->total_app_rtt) / | 537 | app_rtt = (slt->total_app_rtt - prev_log_slt->total_app_rtt) / |
511 | (slt->total_messages_sent - prev_log_slt->total_messages_sent); | 538 | (slt->total_messages_sent - prev_log_slt->total_messages_sent); |
512 | else | 539 | else |
513 | app_rtt = 0; | 540 | app_rtt = prev_log_slt->app_rtt; /* No messages were */ |
514 | } | 541 | } |
515 | slt->app_rtt = app_rtt; | 542 | slt->app_rtt = app_rtt; |
516 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 543 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |