*/
static struct GNUNET_TIME_Absolute connect_last_time;
+/**
+ * At what time did we start the hostkey creation process.
+ */
+static struct GNUNET_TIME_Absolute hostkey_start_time;
+
+/**
+ * At what time did we start the peer startup process.
+ */
+static struct GNUNET_TIME_Absolute peer_start_time;
+
/**
* Boolean value, should the driver issue find peer requests
* (GNUNET_YES) or should it be left to the service (GNUNET_NO)
free_meter (get_meter);
GNUNET_asprintf (&temp_get_string,
- "DHT Successful GETs (trial %d)", trial_to_run);
+ "DHT Successful GETs", trial_to_run);
GNUNET_asprintf (&revision_str, "%llu", revision);
if (GNUNET_YES == insert_gauger_data)
GAUGER_ID("DHT_TESTING", temp_get_string, cumulative_successful_gets / (double)cumulative_num_gets, "percent successful", revision_str);
{
struct TestGetContext *test_get = cls;
- if (tc->reason == GNUNET_SCHEDULER_REASON_TIMEOUT)
+ if ( (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT) != 0)
gets_failed++;
else
cumulative_successful_gets++;
outstanding_puts--;
puts_completed++;
- if (tc->reason == GNUNET_SCHEDULER_REASON_TIMEOUT)
+ if ( (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT) != 0)
fprintf (stderr, "PUT Request failed!\n");
/* Reset the daemon (which peer to insert at) for later put request iterations */
unsigned long long total_duration;
unsigned int new_connections;
unsigned int new_failed_connections;
- double conns_per_sec_recent;
- double conns_per_sec_total;
- double failed_conns_per_sec_recent;
- double failed_conns_per_sec_total;
+ long double conns_per_sec_recent;
+ long double conns_per_sec_total;
+ long double failed_conns_per_sec_recent;
+ long double failed_conns_per_sec_total;
char *temp_conn_string;
char *temp_conn_failed_string;
char *revision_str;
GNUNET_TIME_absolute_get ()).rel_value
/ 1000;
- failed_conns_per_sec_recent = (double) new_failed_connections / duration;
- failed_conns_per_sec_total = (double) failed_connections / total_duration;
- conns_per_sec_recent = (double) new_connections / duration;
- conns_per_sec_total = (double) total_connections / total_duration;
+ failed_conns_per_sec_recent = (long double) new_failed_connections / duration;
+ failed_conns_per_sec_total = (long double) failed_connections / total_duration;
+ conns_per_sec_recent = (long double) new_connections / duration;
+ conns_per_sec_total = (long double) total_connections / total_duration;
GNUNET_log (
GNUNET_ERROR_TYPE_WARNING,
"Recent: %.2f/s, Total: %.2f/s, Recent failed: %.2f/s, total failed %.2f/s\n",
- conns_per_sec_recent, CONN_UPDATE_DURATION,
+ conns_per_sec_recent,
conns_per_sec_total, failed_conns_per_sec_recent,
failed_conns_per_sec_total);
connect_last_time = GNUNET_TIME_absolute_get ();
= GNUNET_TIME_absolute_get_difference (connect_start_time,
GNUNET_TIME_absolute_get ()).rel_value
/ 1000;
- failed_conns_per_sec_total = (double) failed_connections / total_duration;
- conns_per_sec_total = (double) total_connections / total_duration;
+ failed_conns_per_sec_total = (long double) failed_connections / total_duration;
+ conns_per_sec_total = (long double) total_connections / total_duration;
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Overall connection info --- Total: %u, Total Failed %u/s\n",
total_connections, failed_connections);
conns_per_sec_total, failed_conns_per_sec_total);
GNUNET_asprintf (&temp_conn_string,
- "DHT Profiler Connection (trial %d)",
+ "DHT Profiler Connection/s",
trial_to_run);
GNUNET_asprintf (&temp_conn_failed_string,
- "DHT Profiler Connection failed (trial %d)",
+ "DHT Profiler Connection/s failed",
trial_to_run);
GNUNET_asprintf (&revision_str, "%llu", revision);
if (GNUNET_YES == insert_gauger_data)
- GAUGER_ID("DHT_TESTING", temp_conn_string, conns_per_sec_total, "conns/s", revision_str);
+ GAUGER_ID("DHT_TESTING", temp_conn_string, (float)conns_per_sec_total, "conns/s", revision_str);
if (GNUNET_YES == insert_gauger_data)
- GAUGER_ID("DHT_TESTING", temp_conn_failed_string, failed_conns_per_sec_total, "failed_conns", revision_str);
+ GAUGER_ID("DHT_TESTING", temp_conn_failed_string, (float)failed_conns_per_sec_total, "failed_conns", revision_str);
GNUNET_free(temp_conn_string);
GNUNET_free(temp_conn_failed_string);
GNUNET_asprintf (&temp_conn_string,
- "DHT Profiler Total Connections (trial %d)",
+ "DHT Profiler Total Connections",
trial_to_run);
GNUNET_asprintf (
&temp_conn_failed_string,
- "DHT Profiler Total Connections failed (trial %d)",
+ "DHT Profiler Total Connections failed",
trial_to_run);
if (GNUNET_YES == insert_gauger_data)
GAUGER_ID("DHT_TESTING", temp_conn_string, total_connections, "conns", revision_str);
const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TESTING_Daemon *d, const char *emsg)
{
+ char *revision_str;
if (emsg != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
#endif
GNUNET_SCHEDULER_cancel (die_task);
+ GNUNET_asprintf (&revision_str, "%llu", revision);
+ if (GNUNET_YES == insert_gauger_data)
+ GAUGER_ID("DHT_TESTING",
+ "peer_startup_time",
+ GNUNET_TIME_absolute_get_duration(peer_start_time).rel_value / (double)num_peers,
+ "ms/peer", revision_str);
+ GNUNET_free(revision_str);
+
expected_connections = UINT_MAX;
if ((pg != NULL) && (peers_left == 0))
{
expected_connections);
}
- if (expected_connections == GNUNET_SYSERR)
+ if (expected_connections == 0)
{
die_task
= GNUNET_SCHEDULER_add_now (&end_badly,
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Topology set up, have %u expected connections, now starting peers!\n", create_expected_connections);
GNUNET_TESTING_daemons_continue_startup (pg);
+ peer_start_time = GNUNET_TIME_absolute_get();
}
else
{
hostkey_callback(void *cls, const struct GNUNET_PeerIdentity *id,
struct GNUNET_TESTING_Daemon *d, const char *emsg)
{
+ char * revision_str;
if (emsg != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"All %d hostkeys created, now creating topology!\n",
num_peers);
+
+ GNUNET_asprintf (&revision_str, "%llu", revision);
+ if (GNUNET_YES == insert_gauger_data)
+ {
+ if (GNUNET_YES == GNUNET_CONFIGURATION_have_value (config, "TESTING",
+ "HOSTKEYSFILE"))
+ {
+ GAUGER_ID("DHT_TESTING",
+ "HOSTKEY_GENERATION",
+ GNUNET_TIME_absolute_get_duration(hostkey_start_time).rel_value / (double)num_peers,
+ "ms/hostkey", revision_str);
+ }
+ else
+ {
+ GAUGER_ID("DHT_TESTING",
+ "HOSTKEY_GENERATION_REAL",
+ GNUNET_TIME_absolute_get_duration(hostkey_start_time).rel_value / (double)num_peers,
+ "ms/hostkey", revision_str);
+ }
+ }
+
+ GNUNET_free(revision_str);
+
GNUNET_SCHEDULER_cancel (die_task);
/* Set up task in case topology creation doesn't finish
* within a reasonable amount of time */
"do_find_peer"))
do_find_peer = GNUNET_YES;
- if (GNUNET_NO == GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht",
+ if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (cfg, "dht_testing",
"insert_gauger_data"))
insert_gauger_data = GNUNET_YES;
put_meter = create_meter (num_puts, "Puts completed ", GNUNET_YES);
get_meter = create_meter (num_gets, "Gets completed ", GNUNET_YES);
+ hostkey_start_time = GNUNET_TIME_absolute_get();
pg
= GNUNET_TESTING_daemons_start (
cfg,