make insert trial easier to not screw up
authorNathan S. Evans <evans@in.tum.de>
Tue, 7 Sep 2010 13:00:56 +0000 (13:00 +0000)
committerNathan S. Evans <evans@in.tum.de>
Tue, 7 Sep 2010 13:00:56 +0000 (13:00 +0000)
src/dht/dhtlog.h
src/dht/gnunet-dht-driver.c
src/dht/plugin_dhtlog_dummy.c
src/dht/plugin_dhtlog_mysql.c
src/dht/plugin_dhtlog_mysql_dump.c
src/dht/plugin_dhtlog_mysql_dump_load.c

index 1ea044174516a4054c43a0545f5466a559119074..ee594b2f11e603a4137e1b1c97214c0473dfd9aa 100644 (file)
@@ -68,6 +68,91 @@ typedef enum
 
 } DHTLOG_MESSAGE_TYPES;
 
+struct GNUNET_DHTLOG_TrialInfo
+{
+  /**
+   * Trialuid, possibly set by insert call.
+   */
+  unsigned long long trialuid;
+
+  /**
+   * Outside of database identifier for the trial.
+   */
+  unsigned int other_identifier;
+
+  /** Number of nodes in the trial */
+  unsigned int num_nodes;
+
+  /** Type of initial topology */
+  unsigned int topology;
+
+  /** Topology to blacklist peers to */
+  unsigned int blacklist_topology;
+
+  /** Initially connect peers in this topology */
+  unsigned int connect_topology;
+
+  /** Option to modify connect topology */
+  unsigned int connect_topology_option;
+
+  /** Modifier for the connect option */
+  float connect_topology_option_modifier;
+
+  /** Percentage parameter used for certain topologies */
+  float topology_percentage;
+
+  /** Probability parameter used for certain topologies */
+  float topology_probability;
+
+  /** Number of puts in the trial */
+  unsigned int puts;
+
+  /** Number of gets in the trial */
+  unsigned int gets;
+
+  /** Concurrent puts/gets in the trial (max allowed) */
+  unsigned int concurrent;
+
+  /** How long between initial connection and issuing puts/gets */
+  unsigned int settle_time;
+
+  /** How many times to do put/get loop */
+  unsigned int num_rounds;
+
+  /** Number of malicious getters */
+  unsigned int malicious_getters;
+
+  /** Number of malicious putters */
+  unsigned int malicious_putters;
+
+  /** Number of malicious droppers */
+  unsigned int malicious_droppers;
+
+  /** Frequency of malicious get requests */
+  unsigned int malicious_get_frequency;
+
+  /** Frequency of malicious put requests */
+  unsigned int malicious_put_frequency;
+
+  /** Stop forwarding put/find_peer requests when peer is closer than others */
+  unsigned int stop_closest;
+
+  /** Stop forwarding get requests when data found */
+  unsigned int stop_found;
+
+  /**
+   * Routing behaves as it would in Kademlia (modified to work recursively,
+   * and with our other GNUnet constraints.
+   */
+  unsigned int strict_kademlia;
+
+  /** Number of gets that were reported successful */
+  unsigned int gets_succeeded;
+
+  /** Message for this trial */
+  char *message;
+};
+
 struct GNUNET_DHTLOG_Handle
 {
 
@@ -94,45 +179,11 @@ struct GNUNET_DHTLOG_Handle
   /*
    * Inserts the specified trial into the dhttests.trials table
    *
-   * @param trialuid return the trialuid of the newly inserted trial
-   * @param other_identifier identifier for the trial from another source
-   *        (for joining later)
-   * @param num_nodes how many nodes are in the trial
-   * @param topology integer representing topology for this trial
-   * @param blacklist_topology integer representing blacklist topology for this trial
-   * @param connect_topology integer representing connect topology for this trial
-   * @param connect_topology_option integer representing connect topology option
-   * @param connect_topology_option_modifier float to modify connect option
-   * @param topology_percentage percentage modifier for certain topologies
-   * @param topology_probability probability modifier for certain topologies
-   * @param puts number of puts to perform
-   * @param gets number of gets to perform
-   * @param concurrent number of concurrent requests
-   * @param settle_time time to wait between creating topology and starting testing
-   * @param num_rounds number of times to repeat the trial
-   * @param malicious_getters number of malicious GET peers in the trial
-   * @param malicious_putters number of malicious PUT peers in the trial
-   * @param malicious_droppers number of malicious DROP peers in the trial
-   * @param malicious_get_frequency how often malicious gets are sent
-   * @param malicious_put_frequency how often malicious puts are sent
-   * @param stop_closest stop forwarding PUTs if closest node found
-   * @param stop_found stop forwarding GETs if data found
-   * @param strict_kademlia test used kademlia routing algorithm
-   * @param gets_succeeded how many gets did the test driver report success on
-   * @param message string to put into DB for this trial
+   * @param trial_info general information about this trial
    *
    * @return GNUNET_OK on success, GNUNET_SYSERR on failure
    */
-  int (*insert_trial) (unsigned long long *trialuid, unsigned int other_identifier, unsigned int num_nodes, unsigned int topology,
-                       unsigned int blacklist_topology, unsigned int connect_topology,
-                       unsigned int connect_topology_option, float connect_topology_option_modifier,
-                       float topology_percentage, float topology_probability,
-                       unsigned int puts, unsigned int gets, unsigned int concurrent, unsigned int settle_time,
-                       unsigned int num_rounds, unsigned int malicious_getters, unsigned int malicious_putters,
-                       unsigned int malicious_droppers, unsigned int malicious_get_frequency,
-                       unsigned int malicious_put_frequency, unsigned int stop_closest, unsigned int stop_found,
-                       unsigned int strict_kademlia, unsigned int gets_succeeded,
-                       char *message);
+  int (*insert_trial) (struct GNUNET_DHTLOG_TrialInfo *trial_info);
 
   /*
    * Inserts the specified stats into the dhttests.node_statistics table
index 061ad760ffdfd70fe04c96c2fe7e2a4e39b4c564..07f1fbb04b0581ab254e05d9e444c3c48a86780a 100644 (file)
@@ -1852,6 +1852,7 @@ run (void *cls,
      const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct stat frstat;
+  struct GNUNET_DHTLOG_TrialInfo trial_info;
   struct GNUNET_TESTING_Host *hosts;
   struct GNUNET_TESTING_Host *temphost;
   char *topology_str;
@@ -1875,6 +1876,7 @@ run (void *cls,
 
   sched = s;
   config = cfg;
+  memset(&trial_info, 0, sizeof(struct GNUNET_DHTLOG_TrialInfo));
   /* Get path from configuration file */
   if (GNUNET_YES != GNUNET_CONFIGURATION_get_value_string(cfg, "paths", "servicehome", &test_directory))
     {
@@ -2221,32 +2223,36 @@ run (void *cls,
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "dhtlog_handle is NULL!");
 
-  if ((trialmessage != NULL) && (dhtlog_handle != NULL))
-    {
-      dhtlog_handle->insert_trial (&trialuid, (unsigned int)trial_to_run, peers_left, topology,
-                                    blacklist_topology, connect_topology,
-                                    connect_topology_option,
-                                    connect_topology_option_modifier, topology_percentage,
-                                    topology_probability, num_puts, num_gets,
-                                    max_outstanding_gets, settle_time, 1,
-                                    malicious_getters, malicious_putters,
-                                    malicious_droppers, malicious_get_frequency,
-                                    malicious_put_frequency, stop_closest, stop_found,
-                                    strict_kademlia, 0, trialmessage);
-    }
-  else if (dhtlog_handle != NULL)
-    {
-      dhtlog_handle->insert_trial (&trialuid, (unsigned int)trial_to_run, peers_left, topology,
-                                    blacklist_topology, connect_topology,
-                                    connect_topology_option,
-                                    connect_topology_option_modifier, topology_percentage,
-                                    topology_probability, num_puts, num_gets,
-                                    max_outstanding_gets, settle_time, 1,
-                                    malicious_getters, malicious_putters,
-                                    malicious_droppers, malicious_get_frequency,
-                                    malicious_put_frequency, stop_closest, stop_found,
-                                    strict_kademlia, 0, "");
-    }
+  trial_info.other_identifier = (unsigned int)trial_to_run;
+  trial_info.num_nodes = peers_left;
+  trial_info.topology = topology;
+  trial_info.blacklist_topology = blacklist_topology;
+  trial_info.connect_topology = connect_topology;
+  trial_info.connect_topology_option = connect_topology_option;
+  trial_info.connect_topology_option_modifier = connect_topology_option_modifier;
+  trial_info.topology_percentage = topology_percentage;
+  trial_info.topology_probability = topology_probability;
+  trial_info.puts = num_puts;
+  trial_info.gets = num_gets;
+  trial_info.concurrent = max_outstanding_gets;
+  trial_info.settle_time = settle_time;
+  trial_info.num_rounds = 1;
+  trial_info.malicious_getters = malicious_getters;
+  trial_info.malicious_putters = malicious_putters;
+  trial_info.malicious_droppers = malicious_droppers;
+  trial_info.malicious_get_frequency = malicious_get_frequency;
+  trial_info.malicious_put_frequency = malicious_put_frequency;
+  trial_info.stop_closest = stop_closest;
+  trial_info.stop_found = stop_found;
+  trial_info.strict_kademlia = strict_kademlia;
+
+  if (trialmessage != NULL)
+    trial_info.message = trialmessage;
+  else
+    trial_info.message = "";
+
+  if (dhtlog_handle != NULL)
+    dhtlog_handle->insert_trial(&trial_info);
 
   GNUNET_free_non_null(trialmessage);
 
index 1ea2ac596ea56994ff0fe1da479f770388fca47b..856d119c7a442c65c9f9ff11300bb0871428016a 100644 (file)
 
 #define DEBUG_DHTLOG GNUNET_NO
 
-  /*
-   * Inserts the specified trial into the dhttests.trials table
-   *
-   * @param trialuid return the trialuid of the newly inserted trial
-   * @param other_identifier identifier for the trial from another source
-   *        (for joining later)
-   * @param num_nodes how many nodes are in the trial
-   * @param topology integer representing topology for this trial
-   * @param blacklist_topology integer representing blacklist topology for this trial
-   * @param connect_topology integer representing connect topology for this trial
-   * @param connect_topology_option integer representing connect topology option
-   * @param connect_topology_option_modifier float to modify connect option
-   * @param topology_percentage percentage modifier for certain topologies
-   * @param topology_probability probability modifier for certain topologies
-   * @param puts number of puts to perform
-   * @param gets number of gets to perform
-   * @param concurrent number of concurrent requests
-   * @param settle_time time to wait between creating topology and starting testing
-   * @param num_rounds number of times to repeat the trial
-   * @param malicious_getters number of malicious GET peers in the trial
-   * @param malicious_putters number of malicious PUT peers in the trial
-   * @param malicious_droppers number of malicious DROP peers in the trial
-   * @param malicious_get_frequency how often malicious gets are sent
-   * @param malicious_put_frequency how often malicious puts are sent
-   * @param stop_closest stop forwarding PUTs if closest node found
-   * @param stop_found stop forwarding GETs if data found
-   * @param strict_kademlia test used kademlia routing algorithm
-   * @param gets_succeeded how many gets did the test driver report success on
-   * @param message string to put into DB for this trial
-   *
-   * @return GNUNET_OK on success, GNUNET_SYSERR on failure
-   */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+/*
+ * Inserts the specified trial into the dhttests.trials table
+ *
+ * @param trial_info struct containing the data to insert about this trial
+ *
+ * @return GNUNET_OK on success, GNUNET_SYSERR on failure
+ */
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
-  *trialuid = 42;
+  trial_info->trialuid = 42;
   return GNUNET_OK;
 }
 
index c1029b11b83f4bd7c32e17ba743729df470b2bb6..a3d5ac7a5a7e3c7c6da5b88b62407f0b66c8ab77 100644 (file)
@@ -827,78 +827,44 @@ prepared_statement_run (struct StatementHandle *s,
 /*
  * Inserts the specified trial into the dhttests.trials table
  *
- * @param trialuid return the trialuid of the newly inserted trial
- * @param other_identifier identifier for the trial from another source
- *        (for joining later)
- * @param num_nodes how many nodes are in the trial
- * @param topology integer representing topology for this trial
- * @param blacklist_topology integer representing blacklist topology for this trial
- * @param connect_topology integer representing connect topology for this trial
- * @param connect_topology_option integer representing connect topology option
- * @param connect_topology_option_modifier float to modify connect option
- * @param topology_percentage percentage modifier for certain topologies
- * @param topology_probability probability modifier for certain topologies
- * @param puts number of puts to perform
- * @param gets number of gets to perform
- * @param concurrent number of concurrent requests
- * @param settle_time time to wait between creating topology and starting testing
- * @param num_rounds number of times to repeat the trial
- * @param malicious_getters number of malicious GET peers in the trial
- * @param malicious_putters number of malicious PUT peers in the trial
- * @param malicious_droppers number of malicious DROP peers in the trial
- * @param malicious_get_frequency how often malicious gets are sent
- * @param malicious_put_frequency how often malicious puts are sent
- * @param stop_closest stop forwarding PUTs if closest node found
- * @param stop_found stop forwarding GETs if data found
- * @param strict_kademlia test used kademlia routing algorithm
- * @param gets_succeeded how many gets did the test driver report success on
- * @param message string to put into DB for this trial
+ * @param trial_info struct containing the data to insert about this trial
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
   MYSQL_STMT *stmt;
   int ret;
   unsigned long long m_len;
-  m_len = strlen (message);
+  m_len = strlen (trial_info->message);
 
   stmt = mysql_stmt_init(conn);
   if (GNUNET_OK !=
-      (ret = prepared_statement_run (insert_trial, trialuid,
-                                     MYSQL_TYPE_LONG, &other_identifier, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &num_nodes, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &topology, GNUNET_YES,
-                                     MYSQL_TYPE_FLOAT, &topology_percentage,
-                                     MYSQL_TYPE_FLOAT, &topology_probability,
-                                     MYSQL_TYPE_LONG, &blacklist_topology, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &connect_topology, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &connect_topology_option, GNUNET_YES,
-                                     MYSQL_TYPE_FLOAT, &connect_topology_option_modifier,
-                                     MYSQL_TYPE_LONG, &puts, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &gets, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &concurrent, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &settle_time, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &num_rounds, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_getters, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_putters, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_droppers, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_get_frequency, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_put_frequency, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &stop_closest, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &stop_found, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &strict_kademlia, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &gets_succeeded, GNUNET_YES,
-                                     MYSQL_TYPE_BLOB, message, max_varchar_len +
+      (ret = prepared_statement_run (insert_trial, &trial_info->trialuid,
+                                     MYSQL_TYPE_LONG, &trial_info->other_identifier, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->num_nodes, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->topology, GNUNET_YES,
+                                     MYSQL_TYPE_FLOAT, &trial_info->topology_percentage,
+                                     MYSQL_TYPE_FLOAT, &trial_info->topology_probability,
+                                     MYSQL_TYPE_LONG, &trial_info->blacklist_topology, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->connect_topology, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->connect_topology_option, GNUNET_YES,
+                                     MYSQL_TYPE_FLOAT, &trial_info->connect_topology_option_modifier,
+                                     MYSQL_TYPE_LONG, &trial_info->puts, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->gets, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->concurrent, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->settle_time, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->num_rounds, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->malicious_getters, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->malicious_putters, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->malicious_droppers, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->malicious_get_frequency, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->malicious_put_frequency, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->stop_closest, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->stop_found, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->strict_kademlia, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->gets_succeeded, GNUNET_YES,
+                                     MYSQL_TYPE_BLOB, trial_info->message, max_varchar_len +
                                      max_varchar_len, &m_len,
                                       -1)))
     {
index 2fa31d297508bc5ecb7d4fe8f250bade4c8c8e1b..f58d6782a8b625f77db673999166b136a7b8f301 100644 (file)
@@ -256,49 +256,14 @@ add_extended_topology (const struct GNUNET_PeerIdentity *first, const struct GNU
 /*
  * Inserts the specified trial into the dhttests.trials table
  *
- * @param trialuid return the trialuid of the newly inserted trial
- * @param other_identifier identifier for the trial from another source
- *        (for joining later)
- * @param num_nodes how many nodes are in the trial
- * @param topology integer representing topology for this trial
- * @param blacklist_topology integer representing blacklist topology for this trial
- * @param connect_topology integer representing connect topology for this trial
- * @param connect_topology_option integer representing connect topology option
- * @param connect_topology_option_modifier float to modify connect option
- * @param topology_percentage percentage modifier for certain topologies
- * @param topology_probability probability modifier for certain topologies
- * @param puts number of puts to perform
- * @param gets number of gets to perform
- * @param concurrent number of concurrent requests
- * @param settle_time time to wait between creating topology and starting testing
- * @param num_rounds number of times to repeat the trial
- * @param malicious_getters number of malicious GET peers in the trial
- * @param malicious_putters number of malicious PUT peers in the trial
- * @param malicious_droppers number of malicious DROP peers in the trial
- * @param malicious_get_frequency how often malicious gets are sent
- * @param malicious_put_frequency how often malicious puts are sent
- * @param stop_closest stop forwarding PUTs if closest node found
- * @param stop_found stop forwarding GETs if data found
- * @param strict_kademlia test used kademlia routing algorithm
- * @param gets_succeeded how many gets did the test driver report success on
- * @param message string to put into DB for this trial
+ * @param trial_info struct containing the data to insert about this trial
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
   int ret;
-  if (trialuid != NULL)
-    *trialuid = 0;
+  trial_info->trialuid = 0;
   if (outfile == NULL)
     return GNUNET_SYSERR;
 
@@ -309,14 +274,14 @@ int add_trial (unsigned long long *trialuid, unsigned int other_identifier, unsi
                    "@m_gets = %u, @m_puts = %u, @m_drops = %u, "
                    "@m_g_f = %u, @m_p_f = %u, @s_c = %u, @s_f = %u,"
                    "@s_k = %u, @g_s = %u, @message = \"%s\";\n",
-                   get_sql_time(), other_identifier, num_nodes, topology,
-                   blacklist_topology, connect_topology,
-                   connect_topology_option, connect_topology_option_modifier,
-                   topology_percentage, topology_probability,
-                   puts, gets, concurrent, settle_time,
-                   num_rounds, malicious_getters, malicious_putters,
-                   malicious_droppers, malicious_get_frequency, malicious_put_frequency,
-                   stop_closest, stop_found, strict_kademlia, gets_succeeded, message);
+                   get_sql_time(), trial_info->other_identifier, trial_info->num_nodes, trial_info->topology,
+                   trial_info->blacklist_topology, trial_info->connect_topology,
+                   trial_info->connect_topology_option, trial_info->connect_topology_option_modifier,
+                   trial_info->topology_percentage, trial_info->topology_probability,
+                   trial_info->puts, trial_info->gets, trial_info->concurrent, trial_info->settle_time,
+                   trial_info->num_rounds, trial_info->malicious_getters, trial_info->malicious_putters,
+                   trial_info->malicious_droppers, trial_info->malicious_get_frequency, trial_info->malicious_put_frequency,
+                   trial_info->stop_closest, trial_info->stop_found, trial_info->strict_kademlia, trial_info->gets_succeeded, trial_info->message);
 
   if (ret < 0)
     return GNUNET_SYSERR;
index 7072c4b525706337448b70a91e95fde23b9829b7..32733d03ac1fb79e62cc1047d42a9308ce3639b6 100644 (file)
@@ -138,49 +138,14 @@ add_extended_topology (const struct GNUNET_PeerIdentity *first, const struct GNU
 /*
  * Inserts the specified trial into the dhttests.trials table
  *
- * @param trialuid return the trialuid of the newly inserted trial
- * @param other_identifier identifier for the trial from another source
- *        (for joining later)
- * @param num_nodes how many nodes are in the trial
- * @param topology integer representing topology for this trial
- * @param blacklist_topology integer representing blacklist topology for this trial
- * @param connect_topology integer representing connect topology for this trial
- * @param connect_topology_option integer representing connect topology option
- * @param connect_topology_option_modifier float to modify connect option
- * @param topology_percentage percentage modifier for certain topologies
- * @param topology_probability probability modifier for certain topologies
- * @param puts number of puts to perform
- * @param gets number of gets to perform
- * @param concurrent number of concurrent requests
- * @param settle_time time to wait between creating topology and starting testing
- * @param num_rounds number of times to repeat the trial
- * @param malicious_getters number of malicious GET peers in the trial
- * @param malicious_putters number of malicious PUT peers in the trial
- * @param malicious_droppers number of malicious DROP peers in the trial
- * @param malicious_get_frequency how often malicious gets are sent
- * @param malicious_put_frequency how often malicious puts are sent
- * @param stop_closest stop forwarding PUTs if closest node found
- * @param stop_found stop forwarding GETs if data found
- * @param strict_kademlia test used kademlia routing algorithm
- * @param gets_succeeded how many gets did the test driver report success on
- * @param message string to put into DB for this trial
+ * @param trial_info struct containing the data to insert about this trial
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
   int ret;
-  if (trialuid != NULL)
-    *trialuid = 0;
+  trial_info->trialuid = 0;
   if (outfile == NULL)
     return GNUNET_SYSERR;
 
@@ -194,14 +159,14 @@ int add_trial (unsigned long long *trialuid, unsigned int other_identifier, unsi
                            "malicious_put_frequency, stop_closest, stop_found, strict_kademlia, "
                            "gets_succeeded, message) "
                            "VALUES (\"%s\", %u, %u, %u, %u, %u, %u, %f, %f, %f, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, \"%s\");\n",
-                           get_sql_time(), other_identifier, num_nodes, topology,
-                           blacklist_topology, connect_topology,
-                           connect_topology_option, connect_topology_option_modifier,
-                           topology_percentage, topology_probability,
-                           puts, gets, concurrent, settle_time,
-                           num_rounds, malicious_getters, malicious_putters,
-                           malicious_droppers, malicious_get_frequency, malicious_put_frequency,
-                           stop_closest, stop_found, strict_kademlia, gets_succeeded, message);
+                           get_sql_time(), trial_info->other_identifier, trial_info->num_nodes, trial_info->topology,
+                           trial_info->blacklist_topology, trial_info->connect_topology,
+                           trial_info->connect_topology_option, trial_info->connect_topology_option_modifier,
+                           trial_info->topology_percentage, trial_info->topology_probability,
+                           trial_info->puts, trial_info->gets, trial_info->concurrent, trial_info->settle_time,
+                           trial_info->num_rounds, trial_info->malicious_getters, trial_info->malicious_putters,
+                           trial_info->malicious_droppers, trial_info->malicious_get_frequency, trial_info->malicious_put_frequency,
+                           trial_info->stop_closest, trial_info->stop_found, trial_info->strict_kademlia, trial_info->gets_succeeded, trial_info->message);
 
   if (ret < 0)
     return GNUNET_SYSERR;