diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-23 15:00:15 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-23 15:00:15 +0000 |
commit | e8bd1e4c796bb51ed94817c1b5f69197dbfcfcbc (patch) | |
tree | 00cf6370061f48caeeecc9939785aaecacafa69b /src/fs | |
parent | b990e96d17a5ded09737bda9dab84aad3942898b (diff) | |
download | gnunet-e8bd1e4c796bb51ed94817c1b5f69197dbfcfcbc.tar.gz gnunet-e8bd1e4c796bb51ed94817c1b5f69197dbfcfcbc.zip |
-do even fewer stats by default
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 7 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 12 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 2 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 2 | ||||
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p.c | 1 |
5 files changed, 22 insertions, 2 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index aa8e8de27..a129288ab 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -63,6 +63,11 @@ | |||
63 | */ | 63 | */ |
64 | #define COVER_AGE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) | 64 | #define COVER_AGE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
65 | 65 | ||
66 | /** | ||
67 | * Collect an instane number of statistics? May cause excessive IPC. | ||
68 | */ | ||
69 | #define INSANE_STATISTICS GNUNET_NO | ||
70 | |||
66 | 71 | ||
67 | /* ****************************** globals ****************************** */ | 72 | /* ****************************** globals ****************************** */ |
68 | 73 | ||
@@ -296,9 +301,11 @@ consider_request_for_forwarding (void *cls, | |||
296 | 301 | ||
297 | if (GNUNET_YES != GSF_pending_request_test_target_ (pr, peer)) | 302 | if (GNUNET_YES != GSF_pending_request_test_target_ (pr, peer)) |
298 | { | 303 | { |
304 | #if INSANE_STATISTICS | ||
299 | GNUNET_STATISTICS_update (GSF_stats, | 305 | GNUNET_STATISTICS_update (GSF_stats, |
300 | gettext_noop ("# Loopback routes suppressed"), 1, | 306 | gettext_noop ("# Loopback routes suppressed"), 1, |
301 | GNUNET_NO); | 307 | GNUNET_NO); |
308 | #endif | ||
302 | return; | 309 | return; |
303 | } | 310 | } |
304 | GSF_plan_add_ (cp, pr); | 311 | GSF_plan_add_ (cp, pr); |
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 |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index d4080e950..6041a61f6 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -483,8 +483,10 @@ schedule_peer_transmission (void *cls, | |||
483 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_peer_transmission, pp); | 483 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_peer_transmission, pp); |
484 | return; | 484 | return; |
485 | } | 485 | } |
486 | #if INSANE_STATISTICS | ||
486 | GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# query plans executed"), | 487 | GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# query plans executed"), |
487 | 1, GNUNET_NO); | 488 | 1, GNUNET_NO); |
489 | #endif | ||
488 | /* process from priority heap */ | 490 | /* process from priority heap */ |
489 | rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap); | 491 | rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap); |
490 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing query plan %p\n", rp); | 492 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing query plan %p\n", rp); |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 4f94518df..f39f3fb78 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -826,10 +826,12 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
826 | last_transmission, prq->type, prq->data, prq->size); | 826 | last_transmission, prq->type, prq->data, prq->size); |
827 | return GNUNET_YES; | 827 | return GNUNET_YES; |
828 | case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: | 828 | case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: |
829 | #if INSANE_STATISTICS | ||
829 | GNUNET_STATISTICS_update (GSF_stats, | 830 | GNUNET_STATISTICS_update (GSF_stats, |
830 | gettext_noop | 831 | gettext_noop |
831 | ("# duplicate replies discarded (bloomfilter)"), | 832 | ("# duplicate replies discarded (bloomfilter)"), |
832 | 1, GNUNET_NO); | 833 | 1, GNUNET_NO); |
834 | #endif | ||
833 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 835 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
834 | "Duplicate response, discarding.\n"); | 836 | "Duplicate response, discarding.\n"); |
835 | return GNUNET_YES; /* duplicate */ | 837 | return GNUNET_YES; /* duplicate */ |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 76b4a2f69..9844006e5 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -73,7 +73,6 @@ struct StatValues | |||
73 | * Statistics we print out. | 73 | * Statistics we print out. |
74 | */ | 74 | */ |
75 | static struct StatValues stats[] = { | 75 | static struct StatValues stats[] = { |
76 | {"fs", "# artificial delays introduced (ms)"}, | ||
77 | {"fs", "# queries forwarded"}, | 76 | {"fs", "# queries forwarded"}, |
78 | {"fs", "# replies received and matched"}, | 77 | {"fs", "# replies received and matched"}, |
79 | {"fs", "# results found locally"}, | 78 | {"fs", "# results found locally"}, |