diff options
author | Julius Bünger <buenger@mytum.de> | 2018-01-25 16:05:35 +0100 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-01-25 16:05:35 +0100 |
commit | c53cced7bc23c27544a48a6b515b6f6407e4bfa3 (patch) | |
tree | 4ceca48d986b020d5f7e8ca9283f2b3e0cfa4360 /src/rps | |
parent | aac096bb15f2f0d7ed2450428a2e5d7fcf91c737 (diff) | |
download | gnunet-c53cced7bc23c27544a48a6b515b6f6407e4bfa3.tar.gz gnunet-c53cced7bc23c27544a48a6b515b6f6407e4bfa3.zip |
rps: record more statistic values
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 28 | ||||
-rw-r--r-- | src/rps/test_rps.c | 44 |
2 files changed, 51 insertions, 21 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index aeb0eabc2..56c3c52b6 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -3727,14 +3727,36 @@ do_round (void *cls) | |||
3727 | } else { | 3727 | } else { |
3728 | LOG (GNUNET_ERROR_TYPE_DEBUG, "No update of the view.\n"); | 3728 | LOG (GNUNET_ERROR_TYPE_DEBUG, "No update of the view.\n"); |
3729 | GNUNET_STATISTICS_update(stats, "# rounds blocked", 1, GNUNET_NO); | 3729 | GNUNET_STATISTICS_update(stats, "# rounds blocked", 1, GNUNET_NO); |
3730 | if (CustomPeerMap_size (push_map) > alpha * View_size ()) | 3730 | if (CustomPeerMap_size (push_map) > alpha * View_size () && |
3731 | !(0 >= CustomPeerMap_size (pull_map))) | ||
3731 | GNUNET_STATISTICS_update(stats, "# rounds blocked - too many pushes", 1, GNUNET_NO); | 3732 | GNUNET_STATISTICS_update(stats, "# rounds blocked - too many pushes", 1, GNUNET_NO); |
3732 | if (0 >= CustomPeerMap_size (push_map)) | 3733 | if (CustomPeerMap_size (push_map) > alpha * View_size () && |
3734 | (0 >= CustomPeerMap_size (pull_map))) | ||
3735 | GNUNET_STATISTICS_update(stats, "# rounds blocked - too many pushes, no pull replies", 1, GNUNET_NO); | ||
3736 | if (0 >= CustomPeerMap_size (push_map) && | ||
3737 | !(0 >= CustomPeerMap_size (pull_map))) | ||
3733 | GNUNET_STATISTICS_update(stats, "# rounds blocked - no pushes", 1, GNUNET_NO); | 3738 | GNUNET_STATISTICS_update(stats, "# rounds blocked - no pushes", 1, GNUNET_NO); |
3734 | if (0 >= CustomPeerMap_size (pull_map)) | 3739 | if (0 >= CustomPeerMap_size (push_map) && |
3740 | (0 >= CustomPeerMap_size (pull_map))) | ||
3741 | GNUNET_STATISTICS_update(stats, "# rounds blocked - no pushes, no pull replies", 1, GNUNET_NO); | ||
3742 | if (0 >= CustomPeerMap_size (pull_map) && | ||
3743 | CustomPeerMap_size (push_map) > alpha * View_size () && | ||
3744 | 0 >= CustomPeerMap_size (push_map)) | ||
3735 | GNUNET_STATISTICS_update(stats, "# rounds blocked - no pull replies", 1, GNUNET_NO); | 3745 | GNUNET_STATISTICS_update(stats, "# rounds blocked - no pull replies", 1, GNUNET_NO); |
3736 | } | 3746 | } |
3737 | // TODO independent of that also get some peers from CADET_get_peers()? | 3747 | // TODO independent of that also get some peers from CADET_get_peers()? |
3748 | GNUNET_STATISTICS_set (stats, | ||
3749 | "# peers in push map at end of round", | ||
3750 | CustomPeerMap_size (push_map), | ||
3751 | GNUNET_NO); | ||
3752 | GNUNET_STATISTICS_set (stats, | ||
3753 | "# peers in pull map at end of round", | ||
3754 | CustomPeerMap_size (pull_map), | ||
3755 | GNUNET_NO); | ||
3756 | GNUNET_STATISTICS_set (stats, | ||
3757 | "# peers in view at end of round", | ||
3758 | View_size (), | ||
3759 | GNUNET_NO); | ||
3738 | 3760 | ||
3739 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 3761 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
3740 | "Received %u pushes and %u pulls last round (alpha (%.2f) * view_size (%u) = %.2f)\n", | 3762 | "Received %u pushes and %u pulls last round (alpha (%.2f) * view_size (%u) = %.2f)\n", |
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index cba992740..d304adfe2 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c | |||
@@ -262,20 +262,22 @@ struct RPSPeer | |||
262 | 262 | ||
263 | enum STAT_TYPE | 263 | enum STAT_TYPE |
264 | { | 264 | { |
265 | STAT_TYPE_ROUNDS = 0x1, /* 1 */ | 265 | STAT_TYPE_ROUNDS = 0x1, /* 1 */ |
266 | STAT_TYPE_BLOCKS = 0x2, /* 2 */ | 266 | STAT_TYPE_BLOCKS = 0x2, /* 2 */ |
267 | STAT_TYPE_BLOCKS_MANY_PUSH = 0x4, /* 3 */ | 267 | STAT_TYPE_BLOCKS_MANY_PUSH = 0x4, /* 3 */ |
268 | STAT_TYPE_BLOCKS_FEW_PUSH = 0x8, /* 4 */ | 268 | STAT_TYPE_BLOCKS_NO_PUSH = 0x8, /* 4 */ |
269 | STAT_TYPE_BLOCKS_FEW_PULL = 0x10, /* 5 */ | 269 | STAT_TYPE_BLOCKS_NO_PULL = 0x10, /* 5 */ |
270 | STAT_TYPE_ISSUED_PUSH_SEND = 0x20, /* 6 */ | 270 | STAT_TYPE_BLOCKS_MANY_PUSH_NO_PULL = 0x20, /* 6 */ |
271 | STAT_TYPE_ISSUED_PULL_REQ = 0x40, /* 7 */ | 271 | STAT_TYPE_BLOCKS_NO_PUSH_NO_PULL = 0x40, /* 7 */ |
272 | STAT_TYPE_ISSUED_PULL_REP = 0x80, /* 8 */ | 272 | STAT_TYPE_ISSUED_PUSH_SEND = 0x80, /* 8 */ |
273 | STAT_TYPE_SENT_PUSH_SEND = 0x100, /* 9 */ | 273 | STAT_TYPE_ISSUED_PULL_REQ = 0x100, /* 9 */ |
274 | STAT_TYPE_SENT_PULL_REQ = 0x200, /* 10 */ | 274 | STAT_TYPE_ISSUED_PULL_REP = 0x200, /* 10 */ |
275 | STAT_TYPE_SENT_PULL_REP = 0x400, /* 11 */ | 275 | STAT_TYPE_SENT_PUSH_SEND = 0x400, /* 11 */ |
276 | STAT_TYPE_RECV_PUSH_SEND = 0x800, /* 12 */ | 276 | STAT_TYPE_SENT_PULL_REQ = 0x800, /* 12 */ |
277 | STAT_TYPE_RECV_PULL_REQ = 0x1000, /* 13 */ | 277 | STAT_TYPE_SENT_PULL_REP = 0x1000, /* 13 */ |
278 | STAT_TYPE_RECV_PULL_REP = 0x2000, /* 14 */ | 278 | STAT_TYPE_RECV_PUSH_SEND = 0x2000, /* 14 */ |
279 | STAT_TYPE_RECV_PULL_REQ = 0x4000, /* 15 */ | ||
280 | STAT_TYPE_RECV_PULL_REP = 0x8000, /* 16 */ | ||
279 | STAT_TYPE_MAX = 0x80000000, /* 32 */ | 281 | STAT_TYPE_MAX = 0x80000000, /* 32 */ |
280 | }; | 282 | }; |
281 | 283 | ||
@@ -1850,10 +1852,14 @@ char* stat_type_2_str (enum STAT_TYPE stat_type) | |||
1850 | return "# rounds blocked"; | 1852 | return "# rounds blocked"; |
1851 | case STAT_TYPE_BLOCKS_MANY_PUSH: | 1853 | case STAT_TYPE_BLOCKS_MANY_PUSH: |
1852 | return "# rounds blocked - too many pushes"; | 1854 | return "# rounds blocked - too many pushes"; |
1853 | case STAT_TYPE_BLOCKS_FEW_PUSH: | 1855 | case STAT_TYPE_BLOCKS_NO_PUSH: |
1854 | return "# rounds blocked - no pushes"; | 1856 | return "# rounds blocked - no pushes"; |
1855 | case STAT_TYPE_BLOCKS_FEW_PULL: | 1857 | case STAT_TYPE_BLOCKS_NO_PULL: |
1856 | return "# rounds blocked - no pull replies"; | 1858 | return "# rounds blocked - no pull replies"; |
1859 | case STAT_TYPE_BLOCKS_MANY_PUSH_NO_PULL: | ||
1860 | return "# rounds blocked - too many pushes, no pull replies"; | ||
1861 | case STAT_TYPE_BLOCKS_NO_PUSH_NO_PULL: | ||
1862 | return "# rounds blocked - no pushes, no pull replies"; | ||
1857 | case STAT_TYPE_ISSUED_PUSH_SEND: | 1863 | case STAT_TYPE_ISSUED_PUSH_SEND: |
1858 | return "# push send issued"; | 1864 | return "# push send issued"; |
1859 | case STAT_TYPE_ISSUED_PULL_REQ: | 1865 | case STAT_TYPE_ISSUED_PULL_REQ: |
@@ -2197,8 +2203,10 @@ main (int argc, char *argv[]) | |||
2197 | cur_test_run.stat_collect_flags = STAT_TYPE_ROUNDS | | 2203 | cur_test_run.stat_collect_flags = STAT_TYPE_ROUNDS | |
2198 | STAT_TYPE_BLOCKS | | 2204 | STAT_TYPE_BLOCKS | |
2199 | STAT_TYPE_BLOCKS_MANY_PUSH | | 2205 | STAT_TYPE_BLOCKS_MANY_PUSH | |
2200 | STAT_TYPE_BLOCKS_FEW_PUSH | | 2206 | STAT_TYPE_BLOCKS_NO_PUSH | |
2201 | STAT_TYPE_BLOCKS_FEW_PULL | | 2207 | STAT_TYPE_BLOCKS_NO_PULL | |
2208 | STAT_TYPE_BLOCKS_MANY_PUSH_NO_PULL | | ||
2209 | STAT_TYPE_BLOCKS_NO_PUSH_NO_PULL | | ||
2202 | STAT_TYPE_ISSUED_PUSH_SEND | | 2210 | STAT_TYPE_ISSUED_PUSH_SEND | |
2203 | STAT_TYPE_ISSUED_PULL_REQ | | 2211 | STAT_TYPE_ISSUED_PULL_REQ | |
2204 | STAT_TYPE_ISSUED_PULL_REP | | 2212 | STAT_TYPE_ISSUED_PULL_REP | |