diff options
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.c')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 916289dff..e389a24b2 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -50,6 +50,11 @@ | |||
50 | */ | 50 | */ |
51 | #define REPLY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2) | 51 | #define REPLY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2) |
52 | 52 | ||
53 | /** | ||
54 | * Collect an instane number of statistics? May cause excessive IPC. | ||
55 | */ | ||
56 | #define INSANE_STATISTICS GNUNET_NO | ||
57 | |||
53 | 58 | ||
54 | /** | 59 | /** |
55 | * Handle to cancel a transmission request. | 60 | * Handle to cancel a transmission request. |
@@ -864,11 +869,12 @@ get_randomized_delay () | |||
864 | GNUNET_CRYPTO_random_u32 | 869 | GNUNET_CRYPTO_random_u32 |
865 | (GNUNET_CRYPTO_QUALITY_WEAK, | 870 | (GNUNET_CRYPTO_QUALITY_WEAK, |
866 | 2 * GSF_avg_latency.rel_value + 1)); | 871 | 2 * GSF_avg_latency.rel_value + 1)); |
872 | #if INSANE_STATISTICS | ||
867 | GNUNET_STATISTICS_update (GSF_stats, | 873 | GNUNET_STATISTICS_update (GSF_stats, |
868 | gettext_noop | 874 | gettext_noop |
869 | ("# artificial delays introduced (ms)"), | 875 | ("# artificial delays introduced (ms)"), |
870 | ret.rel_value, GNUNET_NO); | 876 | ret.rel_value, GNUNET_NO); |
871 | 877 | #endif | |
872 | return ret; | 878 | return ret; |
873 | } | 879 | } |
874 | 880 | ||
@@ -1044,10 +1050,12 @@ bound_priority (uint32_t prio_in, struct GSF_ConnectedPeer *cp) | |||
1044 | ld = GSF_test_get_load_too_high_ (0); | 1050 | ld = GSF_test_get_load_too_high_ (0); |
1045 | if (GNUNET_SYSERR == ld) | 1051 | if (GNUNET_SYSERR == ld) |
1046 | { | 1052 | { |
1053 | #if INSANE_STATISTICS | ||
1047 | GNUNET_STATISTICS_update (GSF_stats, | 1054 | GNUNET_STATISTICS_update (GSF_stats, |
1048 | gettext_noop | 1055 | gettext_noop |
1049 | ("# requests done for free (low load)"), 1, | 1056 | ("# requests done for free (low load)"), 1, |
1050 | GNUNET_NO); | 1057 | GNUNET_NO); |
1058 | #endif | ||
1051 | return 0; /* excess resources */ | 1059 | return 0; /* excess resources */ |
1052 | } | 1060 | } |
1053 | if (prio_in > INT32_MAX) | 1061 | if (prio_in > INT32_MAX) |
@@ -1213,10 +1221,12 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
1213 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1221 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1214 | "Failed to find peer `%4s' in connection set. Dropping query.\n", | 1222 | "Failed to find peer `%4s' in connection set. Dropping query.\n", |
1215 | GNUNET_i2s (other)); | 1223 | GNUNET_i2s (other)); |
1224 | #if INSANE_STATISTICS | ||
1216 | GNUNET_STATISTICS_update (GSF_stats, | 1225 | GNUNET_STATISTICS_update (GSF_stats, |
1217 | gettext_noop | 1226 | gettext_noop |
1218 | ("# requests dropped due to missing reverse route"), | 1227 | ("# requests dropped due to missing reverse route"), |
1219 | 1, GNUNET_NO); | 1228 | 1, GNUNET_NO); |
1229 | #endif | ||
1220 | return NULL; | 1230 | return NULL; |
1221 | } | 1231 | } |
1222 | /* note that we can really only check load here since otherwise | 1232 | /* note that we can really only check load here since otherwise |