diff options
Diffstat (limited to 'src/dht/gnunet_dht_profiler.c')
-rw-r--r-- | src/dht/gnunet_dht_profiler.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c index 53c120950..c5475c604 100644 --- a/src/dht/gnunet_dht_profiler.c +++ b/src/dht/gnunet_dht_profiler.c | |||
@@ -461,8 +461,6 @@ bandwidth_stats_iterator (void *cls, | |||
461 | static const char *s_sent = "# Bytes transmitted to other peers"; | 461 | static const char *s_sent = "# Bytes transmitted to other peers"; |
462 | static const char *s_recv = "# Bytes received from other peers"; | 462 | static const char *s_recv = "# Bytes received from other peers"; |
463 | 463 | ||
464 | DEBUG("inside bandwidth_stats_iterator()\n"); | ||
465 | |||
466 | if (0 == strncmp (s_sent, name, strlen (s_sent))) | 464 | if (0 == strncmp (s_sent, name, strlen (s_sent))) |
467 | outgoing_bandwidth = outgoing_bandwidth + value; | 465 | outgoing_bandwidth = outgoing_bandwidth + value; |
468 | else if (0 == strncmp(s_recv, name, strlen (s_recv))) | 466 | else if (0 == strncmp(s_recv, name, strlen (s_recv))) |
@@ -518,8 +516,6 @@ cancel_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
518 | GNUNET_TESTBED_operation_done (ctx->op); | 516 | GNUNET_TESTBED_operation_done (ctx->op); |
519 | ctx->op = NULL; | 517 | ctx->op = NULL; |
520 | 518 | ||
521 | DEBUG("inside cancel_get()"); | ||
522 | |||
523 | /* If profiling is complete, summarize */ | 519 | /* If profiling is complete, summarize */ |
524 | if (n_active == n_gets_fail + n_gets_ok) | 520 | if (n_active == n_gets_fail + n_gets_ok) |
525 | { | 521 | { |
@@ -577,9 +573,9 @@ get_iter (void *cls, | |||
577 | GNUNET_TESTBED_operation_done (ctx->op); | 573 | GNUNET_TESTBED_operation_done (ctx->op); |
578 | ctx->op = NULL; | 574 | ctx->op = NULL; |
579 | 575 | ||
580 | total_put_path_length = total_put_path_length + put_path_length; | 576 | total_put_path_length = total_put_path_length + (double)put_path_length; |
581 | total_get_path_length = total_get_path_length + get_path_length; | 577 | total_get_path_length = total_get_path_length + (double)get_path_length; |
582 | 578 | DEBUG ("total_put_path_length = %f,put_path \n",total_put_path_length); | |
583 | /* Summarize if profiling is complete */ | 579 | /* Summarize if profiling is complete */ |
584 | if (n_active == n_gets_fail + n_gets_ok) | 580 | if (n_active == n_gets_fail + n_gets_ok) |
585 | { | 581 | { |
@@ -704,7 +700,7 @@ delayed_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
704 | DEBUG ("PUT_REQUEST_START key %s \n", GNUNET_h2s((struct GNUNET_HashCode *)ac->put_data)); | 700 | DEBUG ("PUT_REQUEST_START key %s \n", GNUNET_h2s((struct GNUNET_HashCode *)ac->put_data)); |
705 | ac->dht_put = GNUNET_DHT_put (ac->dht, &ac->hash, | 701 | ac->dht_put = GNUNET_DHT_put (ac->dht, &ac->hash, |
706 | replication, | 702 | replication, |
707 | GNUNET_DHT_RO_NONE, | 703 | GNUNET_DHT_RO_RECORD_ROUTE, |
708 | GNUNET_BLOCK_TYPE_TEST, | 704 | GNUNET_BLOCK_TYPE_TEST, |
709 | ac->put_data_size, | 705 | ac->put_data_size, |
710 | ac->put_data, | 706 | ac->put_data, |
@@ -750,7 +746,6 @@ dht_connected (void *cls, | |||
750 | { | 746 | { |
751 | struct GNUNET_TIME_Relative peer_delay_put; | 747 | struct GNUNET_TIME_Relative peer_delay_put; |
752 | peer_delay_put.rel_value_us = | 748 | peer_delay_put.rel_value_us = |
753 | delay_put.rel_value_us + | ||
754 | GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | 749 | GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, |
755 | delay_put.rel_value_us); | 750 | delay_put.rel_value_us); |
756 | ac->delay_task = GNUNET_SCHEDULER_add_delayed (peer_delay_put, &delayed_put, ac); | 751 | ac->delay_task = GNUNET_SCHEDULER_add_delayed (peer_delay_put, &delayed_put, ac); |
@@ -936,7 +931,7 @@ successor_stats_cont (void *cls, | |||
936 | NULL)); | 931 | NULL)); |
937 | 932 | ||
938 | successor_peer_hashmap = GNUNET_CONTAINER_multihashmap_create (num_peers, | 933 | successor_peer_hashmap = GNUNET_CONTAINER_multihashmap_create (num_peers, |
939 | GNUNET_NO); | 934 | GNUNET_NO); |
940 | //TODO:Check if comparison is correct. | 935 | //TODO:Check if comparison is correct. |
941 | if ((start_val == val) && (count == num_peers)) | 936 | if ((start_val == val) && (count == num_peers)) |
942 | { | 937 | { |