aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-08-23 15:10:27 +0200
committerJulius Bünger <buenger@mytum.de>2018-08-23 15:10:27 +0200
commitec3fa3ccab30ae825bae8f5c585c1604bef2b7bc (patch)
tree3089ec1c0d4d16a386f41d7e8fd227c6fb1ad701
parent517266896853562ea49c26e707419ca0c5444fff (diff)
downloadgnunet-ec3fa3ccab30ae825bae8f5c585c1604bef2b7bc.tar.gz
gnunet-ec3fa3ccab30ae825bae8f5c585c1604bef2b7bc.zip
Introduce more statistical values (rps service)
-rw-r--r--src/rps/gnunet-service-rps.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 84aa1c51c..7802b183b 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -528,6 +528,10 @@ add_valid_peer (const struct GNUNET_PeerIdentity *peer)
528 } 528 }
529 (void) GNUNET_CONTAINER_multipeermap_put (valid_peers, peer, NULL, 529 (void) GNUNET_CONTAINER_multipeermap_put (valid_peers, peer, NULL,
530 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); 530 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
531 GNUNET_STATISTICS_set (stats,
532 "# valid peers",
533 GNUNET_CONTAINER_multipeermap_size (valid_peers),
534 GNUNET_NO);
531 return ret; 535 return ret;
532} 536}
533 537
@@ -2145,6 +2149,7 @@ static int
2145insert_in_view (const struct GNUNET_PeerIdentity *peer) 2149insert_in_view (const struct GNUNET_PeerIdentity *peer)
2146{ 2150{
2147 int online; 2151 int online;
2152 int ret;
2148 2153
2149 online = check_peer_flag (peer, Peers_ONLINE); 2154 online = check_peer_flag (peer, Peers_ONLINE);
2150 if ( (GNUNET_NO == online) || 2155 if ( (GNUNET_NO == online) ||
@@ -2156,7 +2161,9 @@ insert_in_view (const struct GNUNET_PeerIdentity *peer)
2156 } 2161 }
2157 /* Open channel towards peer to keep connection open */ 2162 /* Open channel towards peer to keep connection open */
2158 indicate_sending_intention (peer); 2163 indicate_sending_intention (peer);
2159 return View_put (peer); 2164 ret = View_put (peer);
2165 GNUNET_STATISTICS_set (stats, "view size", View_size(), GNUNET_NO);
2166 return ret;
2160} 2167}
2161 2168
2162/** 2169/**
@@ -2443,6 +2450,10 @@ got_peer (const struct GNUNET_PeerIdentity *peer)
2443 schedule_operation (peer, insert_in_sampler); 2450 schedule_operation (peer, insert_in_sampler);
2444 schedule_operation (peer, insert_in_view_op); 2451 schedule_operation (peer, insert_in_view_op);
2445 } 2452 }
2453 GNUNET_STATISTICS_update (stats,
2454 "# learnd peers",
2455 1,
2456 GNUNET_NO);
2446} 2457}
2447 2458
2448/** 2459/**
@@ -2639,6 +2650,7 @@ nse_callback (void *cls,
2639 //sampler_size_est_need = view_size_est_min; 2650 //sampler_size_est_need = view_size_est_min;
2640 view_size_est_need = view_size_est_min; 2651 view_size_est_need = view_size_est_min;
2641 } 2652 }
2653 GNUNET_STATISTICS_set (stats, "view size aim", view_size_est_need, GNUNET_NO);
2642 2654
2643 /* If the NSE has changed adapt the lists accordingly */ 2655 /* If the NSE has changed adapt the lists accordingly */
2644 resize_wrapper (prot_sampler, sampler_size_est_need); 2656 resize_wrapper (prot_sampler, sampler_size_est_need);
@@ -3809,6 +3821,11 @@ do_round (void *cls)
3809 CustomPeerMap_clear (push_map); 3821 CustomPeerMap_clear (push_map);
3810 CustomPeerMap_clear (pull_map); 3822 CustomPeerMap_clear (pull_map);
3811 3823
3824 GNUNET_STATISTICS_set (stats,
3825 "view size",
3826 View_size(),
3827 GNUNET_NO);
3828
3812 struct GNUNET_TIME_Relative time_next_round; 3829 struct GNUNET_TIME_Relative time_next_round;
3813 3830
3814 time_next_round = compute_rand_delay (round_interval, 2); 3831 time_next_round = compute_rand_delay (round_interval, 2);
@@ -4125,6 +4142,7 @@ run (void *cls,
4125 4142
4126 4143
4127 View_create (view_size_est_min); 4144 View_create (view_size_est_min);
4145 GNUNET_STATISTICS_set (stats, "view size aim", view_size_est_min, GNUNET_NO);
4128 4146
4129 /* file_name_view_log */ 4147 /* file_name_view_log */
4130 file_name_view_log = store_prefix_file_name (&own_identity, "view"); 4148 file_name_view_log = store_prefix_file_name (&own_identity, "view");