aboutsummaryrefslogtreecommitdiff
path: root/src/dht/plugin_dhtlog_mysql_dump.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-08-12 16:21:04 +0000
committerNathan S. Evans <evans@in.tum.de>2010-08-12 16:21:04 +0000
commitb20b2447cf07e57a5ff19c1829b9dc5cdc561352 (patch)
treef182a75472d3e3a43f69c8245399d443a0e3811d /src/dht/plugin_dhtlog_mysql_dump.c
parenta8db4c30c6a21049f2189941e958c4625c4effb3 (diff)
downloadgnunet-b20b2447cf07e57a5ff19c1829b9dc5cdc561352.tar.gz
gnunet-b20b2447cf07e57a5ff19c1829b9dc5cdc561352.zip
myriad changes
Diffstat (limited to 'src/dht/plugin_dhtlog_mysql_dump.c')
-rw-r--r--src/dht/plugin_dhtlog_mysql_dump.c64
1 files changed, 37 insertions, 27 deletions
diff --git a/src/dht/plugin_dhtlog_mysql_dump.c b/src/dht/plugin_dhtlog_mysql_dump.c
index 9db19a202..5c13a3a85 100644
--- a/src/dht/plugin_dhtlog_mysql_dump.c
+++ b/src/dht/plugin_dhtlog_mysql_dump.c
@@ -74,8 +74,10 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
74 "blacklist_topology, connect_topology, connect_topology_option,"\ 74 "blacklist_topology, connect_topology, connect_topology_option,"\
75 "connect_topology_option_modifier, puts, gets, "\ 75 "connect_topology_option_modifier, puts, gets, "\
76 "concurrent, settle_time, num_rounds, malicious_getters,"\ 76 "concurrent, settle_time, num_rounds, malicious_getters,"\
77 "malicious_putters, malicious_droppers, message) "\ 77 "malicious_putters, malicious_droppers, malicious_get_frequency,"\
78 "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'" 78 "malicious_put_frequency, stop_closest, stop_found, strict_kademlia, "\
79 "gets_succeeded, message) "\
80 "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'"
79 81
80#define INSERT_STAT_STMT "prepare insert_stat from 'INSERT INTO node_statistics"\ 82#define INSERT_STAT_STMT "prepare insert_stat from 'INSERT INTO node_statistics"\
81 "(trialuid, nodeuid, route_requests,"\ 83 "(trialuid, nodeuid, route_requests,"\
@@ -89,7 +91,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
89#define INSERT_DHTKEY_STMT "prepare insert_dhtkey from 'INSERT ignore INTO dhtkeys (dhtkey, trialuid) "\ 91#define INSERT_DHTKEY_STMT "prepare insert_dhtkey from 'INSERT ignore INTO dhtkeys (dhtkey, trialuid) "\
90 "VALUES (?, @temp_trial)'" 92 "VALUES (?, @temp_trial)'"
91 93
92#define UPDATE_TRIALS_STMT "prepare update_trial from 'UPDATE trials set endtime= ?, total_messages_dropped = ?, total_bytes_dropped = ?, unknownPeers = ? where trialuid = @temp_trial'" 94#define UPDATE_TRIALS_STMT "prepare update_trial from 'UPDATE trials set endtime= ?, gets_succeeded = ? where trialuid = @temp_trial'"
93 95
94#define UPDATE_CONNECTIONS_STMT "prepare update_conn from 'UPDATE trials set totalConnections = ? where trialuid = @temp_trial'" 96#define UPDATE_CONNECTIONS_STMT "prepare update_conn from 'UPDATE trials set totalConnections = ? where trialuid = @temp_trial'"
95 97
@@ -261,18 +263,26 @@ add_extended_topology (const struct GNUNET_PeerIdentity *first, const struct GNU
261 * @param malicious_getters number of malicious GET peers in the trial 263 * @param malicious_getters number of malicious GET peers in the trial
262 * @param malicious_putters number of malicious PUT peers in the trial 264 * @param malicious_putters number of malicious PUT peers in the trial
263 * @param malicious_droppers number of malicious DROP peers in the trial 265 * @param malicious_droppers number of malicious DROP peers in the trial
266 * @param malicious_get_frequency how often malicious gets are sent
267 * @param malicious_put_frequency how often malicious puts are sent
268 * @param stop_closest stop forwarding PUTs if closest node found
269 * @param stop_found stop forwarding GETs if data found
270 * @param strict_kademlia test used kademlia routing algorithm
271 * @param gets_succeeded how many gets did the test driver report success on
264 * @param message string to put into DB for this trial 272 * @param message string to put into DB for this trial
265 * 273 *
266 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 274 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
267 */ 275 */
268int 276int add_trial (unsigned long long *trialuid, unsigned int num_nodes, unsigned int topology,
269add_trial (unsigned long long *trialuid, int num_nodes, int topology, 277 unsigned int blacklist_topology, unsigned int connect_topology,
270 int blacklist_topology, int connect_topology, 278 unsigned int connect_topology_option, float connect_topology_option_modifier,
271 int connect_topology_option, float connect_topology_option_modifier, 279 float topology_percentage, float topology_probability,
272 float topology_percentage, float topology_probability, 280 unsigned int puts, unsigned int gets, unsigned int concurrent, unsigned int settle_time,
273 int puts, int gets, int concurrent, int settle_time, 281 unsigned int num_rounds, unsigned int malicious_getters, unsigned int malicious_putters,
274 int num_rounds, int malicious_getters, int malicious_putters, 282 unsigned int malicious_droppers, unsigned int malicious_get_frequency,
275 int malicious_droppers, char *message) 283 unsigned int malicious_put_frequency, unsigned int stop_closest, unsigned int stop_found,
284 unsigned int strict_kademlia, unsigned int gets_succeeded,
285 char *message)
276{ 286{
277 int ret; 287 int ret;
278 if (trialuid != NULL) 288 if (trialuid != NULL)
@@ -280,18 +290,21 @@ add_trial (unsigned long long *trialuid, int num_nodes, int topology,
280 if (outfile == NULL) 290 if (outfile == NULL)
281 return GNUNET_SYSERR; 291 return GNUNET_SYSERR;
282 292
283 ret = fprintf(outfile, "set @date = \"%s\", @num = %d, @topology = %d, @bl = %d, " 293 ret = fprintf(outfile, "set @date = \"%s\", @num = %u, @topology = %u, @bl = %u, "
284 "@connect = %d, @c_t_o = %d, @c_t_o_m = %f, @t_p = %f, " 294 "@connect = %u, @c_t_o = %u, @c_t_o_m = %f, @t_p = %f, "
285 "@t_pr = %f, @puts = %d, @gets = %d, " 295 "@t_pr = %f, @puts = %u, @gets = %u, "
286 "@concurrent = %d, @settle = %d, @rounds = %d, " 296 "@concurrent = %u, @settle = %u, @rounds = %u, "
287 "@m_gets = %d, @m_puts = %d, @m_drops = %d, " 297 "@m_gets = %u, @m_puts = %u, @m_drops = %u, "
288 "@message = \"%s\";\n", get_sql_time(), num_nodes, topology, 298 "@m_g_f = %u, @m_p_f = %u, @s_c = %u, @s_f = %u,"
299 "@s_k = %u, @g_s = %u, @message = \"%s\";\n",
300 get_sql_time(), num_nodes, topology,
289 blacklist_topology, connect_topology, 301 blacklist_topology, connect_topology,
290 connect_topology_option, connect_topology_option_modifier, 302 connect_topology_option, connect_topology_option_modifier,
291 topology_percentage, topology_probability, 303 topology_percentage, topology_probability,
292 puts, gets, concurrent, settle_time, 304 puts, gets, concurrent, settle_time,
293 num_rounds, malicious_getters, malicious_putters, 305 num_rounds, malicious_getters, malicious_putters,
294 malicious_droppers, message); 306 malicious_droppers, malicious_get_frequency, malicious_put_frequency,
307 stop_closest, stop_found, strict_kademlia, gets_succeeded, message);
295 308
296 if (ret < 0) 309 if (ret < 0)
297 return GNUNET_SYSERR; 310 return GNUNET_SYSERR;
@@ -301,7 +314,8 @@ add_trial (unsigned long long *trialuid, int num_nodes, int topology,
301 "@c_t_o_m, @puts, @gets," 314 "@c_t_o_m, @puts, @gets,"
302 "@concurrent, @settle, @rounds," 315 "@concurrent, @settle, @rounds,"
303 "@m_gets, @m_puts, @m_drops," 316 "@m_gets, @m_puts, @m_drops,"
304 "@message;\n"); 317 "@m_g_f, @m_p_f, @s_c, @s_f,"
318 "@s_k, @g_s, @message;\n");
305 319
306 ret = fprintf(outfile, "execute select_trial;\n"); 320 ret = fprintf(outfile, "execute select_trial;\n");
307 321
@@ -446,17 +460,13 @@ add_node (unsigned long long *nodeuid, struct GNUNET_PeerIdentity * node)
446 * Update dhttests.trials table with current server time as end time 460 * Update dhttests.trials table with current server time as end time
447 * 461 *
448 * @param trialuid trial to update 462 * @param trialuid trial to update
449 * @param totalMessagesDropped stats value for messages dropped 463 * @param gets_succeeded how many gets did the testcase report as successful
450 * @param totalBytesDropped stats value for total bytes dropped
451 * @param unknownPeers stats value for unknown peers
452 * 464 *
453 * @return GNUNET_OK on success, GNUNET_SYSERR on failure. 465 * @return GNUNET_OK on success, GNUNET_SYSERR on failure.
454 */ 466 */
455int 467int
456update_trials (unsigned long long trialuid, 468update_trials (unsigned long long trialuid,
457 unsigned long long totalMessagesDropped, 469 unsigned int gets_succeeded)
458 unsigned long long totalBytesDropped,
459 unsigned long long unknownPeers)
460{ 470{
461 int ret; 471 int ret;
462#if DEBUG_DHTLOG 472#if DEBUG_DHTLOG
@@ -470,12 +480,12 @@ update_trials (unsigned long long trialuid,
470 if (outfile == NULL) 480 if (outfile == NULL)
471 return GNUNET_SYSERR; 481 return GNUNET_SYSERR;
472 482
473 ret = fprintf(outfile, "set @date = \"%s\", @m_dropped = %llu, @b_dropped = %llu, @unknown = %llu;\n", get_sql_time(), totalMessagesDropped, totalBytesDropped, unknownPeers); 483 ret = fprintf(outfile, "set @date = \"%s\", @g_s = %u;\n", get_sql_time(), gets_succeeded);
474 484
475 if (ret < 0) 485 if (ret < 0)
476 return GNUNET_SYSERR; 486 return GNUNET_SYSERR;
477 487
478 ret = fprintf(outfile, "execute update_trial using @date, @m_dropped, @b_dropped, @unknown;\n"); 488 ret = fprintf(outfile, "execute update_trial using @date, @g_s;\n");
479 489
480 if (ret >= 0) 490 if (ret >= 0)
481 return GNUNET_OK; 491 return GNUNET_OK;