diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-03-24 12:45:45 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-03-24 12:45:45 +0000 |
commit | bd9bb2d8881cde46ba85b59566bc2ba37aec61d7 (patch) | |
tree | 4cefd118fdbf3de15e450e5fab1e9197f4c2c5a0 /src/dht | |
parent | 4f56d94ad72b3a2b80226654c66dc94ebca2b057 (diff) | |
download | gnunet-bd9bb2d8881cde46ba85b59566bc2ba37aec61d7.tar.gz gnunet-bd9bb2d8881cde46ba85b59566bc2ba37aec61d7.zip |
Option for inserting gauger data
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index 21dc9c9d0..9e49bde5c 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -431,6 +431,11 @@ static struct GNUNET_TIME_Absolute connect_last_time; | |||
431 | */ | 431 | */ |
432 | static unsigned int do_find_peer; | 432 | static unsigned int do_find_peer; |
433 | 433 | ||
434 | /** | ||
435 | * Whether or not to insert gauger data. | ||
436 | */ | ||
437 | static unsigned int insert_gauger_data; | ||
438 | |||
434 | #if ONLY_TESTING | 439 | #if ONLY_TESTING |
435 | /** | 440 | /** |
436 | * Are we currently trying to connect two peers repeatedly? | 441 | * Are we currently trying to connect two peers repeatedly? |
@@ -968,7 +973,8 @@ finish_testing(void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
968 | GNUNET_asprintf (&temp_get_string, | 973 | GNUNET_asprintf (&temp_get_string, |
969 | "DHT Successful GETs (trial %d)", trial_to_run); | 974 | "DHT Successful GETs (trial %d)", trial_to_run); |
970 | GNUNET_asprintf (&revision_str, "%llu", revision); | 975 | GNUNET_asprintf (&revision_str, "%llu", revision); |
971 | GAUGER_ID("DHT_TESTING", temp_get_string, cumulative_successful_gets / (double)cumulative_num_gets, "percent successful", revision_str); | 976 | if (GNUNET_YES == insert_gauger_data) |
977 | GAUGER_ID("DHT_TESTING", temp_get_string, cumulative_successful_gets / (double)cumulative_num_gets, "percent successful", revision_str); | ||
972 | fprintf ( | 978 | fprintf ( |
973 | stderr, | 979 | stderr, |
974 | "Finished trial, had %llu successful gets out of %llu total, %.2f percent succeeded\n", | 980 | "Finished trial, had %llu successful gets out of %llu total, %.2f percent succeeded\n", |
@@ -3096,8 +3102,12 @@ topology_callback(void *cls, const struct GNUNET_PeerIdentity *first, | |||
3096 | "DHT Profiler Connection failed (trial %d)", | 3102 | "DHT Profiler Connection failed (trial %d)", |
3097 | trial_to_run); | 3103 | trial_to_run); |
3098 | GNUNET_asprintf (&revision_str, "%llu", revision); | 3104 | GNUNET_asprintf (&revision_str, "%llu", revision); |
3099 | GAUGER_ID("DHT_TESTING", temp_conn_string, conns_per_sec_total, "conns/s", revision_str); | 3105 | |
3100 | GAUGER_ID("DHT_TESTING", temp_conn_failed_string, failed_conns_per_sec_total, "failed_conns", revision_str); | 3106 | if (GNUNET_YES == insert_gauger_data) |
3107 | GAUGER_ID("DHT_TESTING", temp_conn_string, conns_per_sec_total, "conns/s", revision_str); | ||
3108 | if (GNUNET_YES == insert_gauger_data) | ||
3109 | GAUGER_ID("DHT_TESTING", temp_conn_failed_string, failed_conns_per_sec_total, "failed_conns", revision_str); | ||
3110 | |||
3101 | GNUNET_free(temp_conn_string); | 3111 | GNUNET_free(temp_conn_string); |
3102 | GNUNET_free(temp_conn_failed_string); | 3112 | GNUNET_free(temp_conn_failed_string); |
3103 | GNUNET_asprintf (&temp_conn_string, | 3113 | GNUNET_asprintf (&temp_conn_string, |
@@ -3107,8 +3117,10 @@ topology_callback(void *cls, const struct GNUNET_PeerIdentity *first, | |||
3107 | &temp_conn_failed_string, | 3117 | &temp_conn_failed_string, |
3108 | "DHT Profiler Total Connections failed (trial %d)", | 3118 | "DHT Profiler Total Connections failed (trial %d)", |
3109 | trial_to_run); | 3119 | trial_to_run); |
3110 | GAUGER_ID("DHT_TESTING", temp_conn_string, total_connections, "conns", revision_str); | 3120 | if (GNUNET_YES == insert_gauger_data) |
3111 | GAUGER_ID("DHT_TESTING", temp_conn_failed_string, failed_connections, "failed conns", revision_str); | 3121 | GAUGER_ID("DHT_TESTING", temp_conn_string, total_connections, "conns", revision_str); |
3122 | if (GNUNET_YES == insert_gauger_data) | ||
3123 | GAUGER_ID("DHT_TESTING", temp_conn_failed_string, failed_connections, "failed conns", revision_str); | ||
3112 | GNUNET_free(temp_conn_string); | 3124 | GNUNET_free(temp_conn_string); |
3113 | GNUNET_free(temp_conn_failed_string); | 3125 | GNUNET_free(temp_conn_failed_string); |
3114 | GNUNET_free(revision_str); | 3126 | GNUNET_free(revision_str); |
@@ -3791,6 +3803,10 @@ run(void *cls, char * const *args, const char *cfgfile, | |||
3791 | "do_find_peer")) | 3803 | "do_find_peer")) |
3792 | do_find_peer = GNUNET_YES; | 3804 | do_find_peer = GNUNET_YES; |
3793 | 3805 | ||
3806 | if (GNUNET_NO == GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht", | ||
3807 | "insert_gauger_data")) | ||
3808 | insert_gauger_data = GNUNET_YES; | ||
3809 | |||
3794 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht", | 3810 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht", |
3795 | "republish")) | 3811 | "republish")) |
3796 | in_dht_replication = GNUNET_YES; | 3812 | in_dht_replication = GNUNET_YES; |