*/
if ((peer_count->count == 0) && (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0))
{
- GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peers at random to connect to!\n");
+ GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peer(s) at random to connect to!\n");
GNUNET_CONTAINER_heap_iterate (find_peer_context->peer_min_heap, &iterate_min_heap_peers, find_peer_context);
GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context);
}
*/
if (find_peer_context != NULL)
{
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "We have churned on some peers, so we must schedule find peer requests for them!\n");
for (i = 0; i < num_peers; i ++)
{
temp_daemon = GNUNET_TESTING_daemon_get(pg, i);
}
else
{
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Only churned off peers, no find peer requests, scheduling more gets...\n");
if (dhtlog_handle != NULL)
{
topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext));
GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time), &setup_puts_and_gets, NULL);
if (GNUNET_YES == do_find_peer)
- {
- find_peer_context = GNUNET_malloc(sizeof(struct FindPeerContext));
- find_peer_context->count_peers_cb = &count_peers_cb;
- find_peer_context->endtime = GNUNET_TIME_relative_to_absolute(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time));
- GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, find_peer_context);
- }
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling find peer requests during \"settle\" time.\n");
+ find_peer_context = GNUNET_malloc(sizeof(struct FindPeerContext));
+ find_peer_context->count_peers_cb = &count_peers_cb;
+ find_peer_context->endtime = GNUNET_TIME_relative_to_absolute(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time));
+ GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, find_peer_context);
+ }
+ else
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Assuming automatic DHT find peer requests.\n");
+ }
}
/**
churn_data = NULL;
/** Check for a churn file to do churny simulation */
if (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "churn_file",
+ GNUNET_CONFIGURATION_get_value_string(cfg, "dht_testing", "churn_file",
&churn_filename))
{
GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Reading churn data from %s\n", churn_filename);
*/
static MYSQL *conn;
-#define INSERT_QUERIES_STMT "INSERT INTO queries (trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid) "\
- "VALUES (?, ?, ?, ?, ?, ?, ?)"
+#define INSERT_QUERIES_STMT "INSERT INTO queries (trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid, time) "\
+ "VALUES (?, ?, ?, ?, ?, ?, ?, NOW())"
static struct StatementHandle *insert_query;
#define INSERT_ROUTES_STMT "INSERT INTO routes (trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid, from_node, to_node) "\
*/
static const struct GNUNET_CONFIGURATION_Handle *cfg;
-#define INSERT_QUERIES_STMT "prepare insert_query from 'INSERT INTO queries (trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid) "\
- "VALUES (@temp_trial, ?, ?, ?, ?, ?, ?)'"
+#define INSERT_QUERIES_STMT "prepare insert_query from 'INSERT INTO queries (trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid, time) "\
+ "VALUES (@temp_trial, ?, ?, ?, ?, ?, ?, ?)'"
#define INSERT_ROUTES_STMT "prepare insert_route from 'INSERT INTO routes (trialuid, querytype, hops, dhtkeyuid, dhtqueryid, succeeded, nodeuid, from_node, to_node) "\
"VALUES (@temp_trial, ?, ?, ?, ?, ?, ?, ?, ?)'"
if (ret < 0)
return GNUNET_SYSERR;
- ret = fprintf(outfile, "set @qid = %llu, @type = %u, @hops = %u, @succ = %d;\n", queryid, type, hops, succeeded);
+ ret = fprintf(outfile, "set @qid = %llu, @type = %u, @hops = %u, @succ = %d, @time = \"%s\";\n", queryid, type, hops, succeeded, get_sql_time());
if (ret < 0)
return GNUNET_SYSERR;
- ret = fprintf(outfile, "execute insert_query using @type, @hops, @temp_dhtkey, @qid, @succ, @temp_node;\n");
+ ret = fprintf(outfile, "execute insert_query using @type, @hops, @temp_dhtkey, @qid, @succ, @temp_node, @time;\n");
if (ret >= 0)
return GNUNET_OK;
if (ret < 0)
return GNUNET_SYSERR;
- ret = fprintf(query_outfile, "%s\t%llu\t%u\t%u\t%u\n", GNUNET_h2s_full(&node->hashPubKey), queryid, type, hops, succeeded);
+ ret = fprintf(query_outfile, "%s\t%llu\t%u\t%u\t%u\t%s\n", GNUNET_h2s_full(&node->hashPubKey), queryid, type, hops, succeeded, get_sql_time());
if (ret >= 0)
return GNUNET_OK;
SERVICEHOME = /tmp/test-dhtlog/
[DHTLOG]
-PLUGIN = mysql_dump
-#PLUGIN = dummy
+#PLUGIN = mysql_dump
+PLUGIN = dummy
#PLUGIN = mysql
[MYSQL]