-do even fewer stats by default
authorChristian Grothoff <christian@grothoff.org>
Tue, 23 Oct 2012 15:00:15 +0000 (15:00 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 23 Oct 2012 15:00:15 +0000 (15:00 +0000)
src/fs/gnunet-service-fs.c
src/fs/gnunet-service-fs_cp.c
src/fs/gnunet-service-fs_pe.c
src/fs/gnunet-service-fs_pr.c
src/fs/perf_gnunet_service_fs_p2p.c

index aa8e8de27a0e10e42a2b5eb2f1b735e51989c01e..a129288abcaf8acf2aa8bd519e3ccf6850ef8432 100644 (file)
  */
 #define COVER_AGE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
 
+/**
+ * Collect an instane number of statistics?  May cause excessive IPC.
+ */
+#define INSANE_STATISTICS GNUNET_NO
+
 
 /* ****************************** globals ****************************** */
 
@@ -296,9 +301,11 @@ consider_request_for_forwarding (void *cls,
 
   if (GNUNET_YES != GSF_pending_request_test_target_ (pr, peer))
   {
+#if INSANE_STATISTICS
     GNUNET_STATISTICS_update (GSF_stats,
                               gettext_noop ("# Loopback routes suppressed"), 1,
                               GNUNET_NO);
+#endif
     return;
   }
   GSF_plan_add_ (cp, pr);
index 916289dff4d19556a59d701e6fd9bd49cfe545ba..e389a24b2ef77cf05e0343009e9e3dd3a3faa989 100644 (file)
  */
 #define REPLY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2)
 
+/**
+ * Collect an instane number of statistics?  May cause excessive IPC.
+ */
+#define INSANE_STATISTICS GNUNET_NO
+
 
 /**
  * Handle to cancel a transmission request.
@@ -864,11 +869,12 @@ get_randomized_delay ()
                                      GNUNET_CRYPTO_random_u32
                                      (GNUNET_CRYPTO_QUALITY_WEAK,
                                       2 * GSF_avg_latency.rel_value + 1));
+#if INSANE_STATISTICS
   GNUNET_STATISTICS_update (GSF_stats,
                             gettext_noop
                             ("# artificial delays introduced (ms)"),
                             ret.rel_value, GNUNET_NO);
-
+#endif
   return ret;
 }
 
@@ -1044,10 +1050,12 @@ bound_priority (uint32_t prio_in, struct GSF_ConnectedPeer *cp)
   ld = GSF_test_get_load_too_high_ (0);
   if (GNUNET_SYSERR == ld)
   {
+#if INSANE_STATISTICS
     GNUNET_STATISTICS_update (GSF_stats,
                               gettext_noop
                               ("# requests done for free (low load)"), 1,
                               GNUNET_NO);
+#endif
     return 0;                   /* excess resources */
   }
   if (prio_in > INT32_MAX)
@@ -1213,10 +1221,12 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Failed to find peer `%4s' in connection set. Dropping query.\n",
                   GNUNET_i2s (other));
+#if INSANE_STATISTICS
     GNUNET_STATISTICS_update (GSF_stats,
                               gettext_noop
                               ("# requests dropped due to missing reverse route"),
                               1, GNUNET_NO);
+#endif
     return NULL;
   }
   /* note that we can really only check load here since otherwise
index d4080e95040b6cf98651bb814d0e541b1ff3808e..6041a61f6731321d112ece3b8faaa2c67affb8f9 100644 (file)
@@ -483,8 +483,10 @@ schedule_peer_transmission (void *cls,
         GNUNET_SCHEDULER_add_delayed (delay, &schedule_peer_transmission, pp);
     return;
   }
+#if INSANE_STATISTICS
   GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# query plans executed"),
                             1, GNUNET_NO);
+#endif
   /* process from priority heap */
   rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing query plan %p\n", rp);
index 4f94518df28f8791d58010a739ad6503500cf1aa..f39f3fb784083d9bdfa7f0501d7edc9115f15ae1 100644 (file)
@@ -826,10 +826,12 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
             last_transmission, prq->type, prq->data, prq->size);
     return GNUNET_YES;
   case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
+#if INSANE_STATISTICS
     GNUNET_STATISTICS_update (GSF_stats,
                               gettext_noop
                               ("# duplicate replies discarded (bloomfilter)"),
                               1, GNUNET_NO);
+#endif
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Duplicate response, discarding.\n");
     return GNUNET_YES;          /* duplicate */
index 76b4a2f69d0e76f412f8ee09199fe30b04e9a13b..9844006e502747b010197f2add092ed22f8a5e74 100644 (file)
@@ -73,7 +73,6 @@ struct StatValues
  * Statistics we print out.
  */
 static struct StatValues stats[] = {
-  {"fs", "# artificial delays introduced (ms)"},
   {"fs", "# queries forwarded"},
   {"fs", "# replies received and matched"},
   {"fs", "# results found locally"},