diff options
Diffstat (limited to 'src/dht/plugin_dhtlog_mysql_dump_load.c')
-rw-r--r-- | src/dht/plugin_dhtlog_mysql_dump_load.c | 109 |
1 files changed, 54 insertions, 55 deletions
diff --git a/src/dht/plugin_dhtlog_mysql_dump_load.c b/src/dht/plugin_dhtlog_mysql_dump_load.c index 7c3f67942..fada2029e 100644 --- a/src/dht/plugin_dhtlog_mysql_dump_load.c +++ b/src/dht/plugin_dhtlog_mysql_dump_load.c | |||
@@ -222,31 +222,33 @@ add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info) | |||
222 | if (outfile == NULL) | 222 | if (outfile == NULL) |
223 | return GNUNET_SYSERR; | 223 | return GNUNET_SYSERR; |
224 | 224 | ||
225 | ret = fprintf (outfile, "INSERT INTO trials " | 225 | ret = |
226 | "(starttime, other_trial_identifier, numnodes, topology," | 226 | fprintf (outfile, |
227 | "blacklist_topology, connect_topology, connect_topology_option," | 227 | "INSERT INTO trials " |
228 | "connect_topology_option_modifier, topology_percentage, topology_probability," | 228 | "(starttime, other_trial_identifier, numnodes, topology," |
229 | "puts, gets, " | 229 | "blacklist_topology, connect_topology, connect_topology_option," |
230 | "concurrent, settle_time, num_rounds, malicious_getters," | 230 | "connect_topology_option_modifier, topology_percentage, topology_probability," |
231 | "malicious_putters, malicious_droppers, malicious_get_frequency," | 231 | "puts, gets, " |
232 | "malicious_put_frequency, stop_closest, stop_found, strict_kademlia, " | 232 | "concurrent, settle_time, num_rounds, malicious_getters," |
233 | "gets_succeeded, message) " | 233 | "malicious_putters, malicious_droppers, malicious_get_frequency," |
234 | "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", | 234 | "malicious_put_frequency, stop_closest, stop_found, strict_kademlia, " |
235 | get_sql_time (), trial_info->other_identifier, | 235 | "gets_succeeded, message) " |
236 | trial_info->num_nodes, trial_info->topology, | 236 | "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", |
237 | trial_info->blacklist_topology, trial_info->connect_topology, | 237 | get_sql_time (), trial_info->other_identifier, |
238 | trial_info->connect_topology_option, | 238 | trial_info->num_nodes, trial_info->topology, |
239 | trial_info->connect_topology_option_modifier, | 239 | trial_info->blacklist_topology, trial_info->connect_topology, |
240 | trial_info->topology_percentage, | 240 | trial_info->connect_topology_option, |
241 | trial_info->topology_probability, trial_info->puts, | 241 | trial_info->connect_topology_option_modifier, |
242 | trial_info->gets, trial_info->concurrent, | 242 | trial_info->topology_percentage, |
243 | trial_info->settle_time, trial_info->num_rounds, | 243 | trial_info->topology_probability, trial_info->puts, |
244 | trial_info->malicious_getters, trial_info->malicious_putters, | 244 | trial_info->gets, trial_info->concurrent, |
245 | trial_info->malicious_droppers, | 245 | trial_info->settle_time, trial_info->num_rounds, |
246 | trial_info->malicious_get_frequency, | 246 | trial_info->malicious_getters, trial_info->malicious_putters, |
247 | trial_info->malicious_put_frequency, trial_info->stop_closest, | 247 | trial_info->malicious_droppers, |
248 | trial_info->stop_found, trial_info->strict_kademlia, | 248 | trial_info->malicious_get_frequency, |
249 | trial_info->gets_succeeded, trial_info->message); | 249 | trial_info->malicious_put_frequency, trial_info->stop_closest, |
250 | trial_info->stop_found, trial_info->strict_kademlia, | ||
251 | trial_info->gets_succeeded, trial_info->message); | ||
250 | 252 | ||
251 | if (ret < 0) | 253 | if (ret < 0) |
252 | return GNUNET_SYSERR; | 254 | return GNUNET_SYSERR; |
@@ -273,8 +275,8 @@ add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info) | |||
273 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 275 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
274 | */ | 276 | */ |
275 | int | 277 | int |
276 | add_generic_stat (const struct GNUNET_PeerIdentity *peer, | 278 | add_generic_stat (const struct GNUNET_PeerIdentity *peer, const char *name, |
277 | const char *name, const char *section, uint64_t value) | 279 | const char *section, uint64_t value) |
278 | { | 280 | { |
279 | if (outfile == NULL) | 281 | if (outfile == NULL) |
280 | return GNUNET_SYSERR; | 282 | return GNUNET_SYSERR; |
@@ -315,10 +317,10 @@ int | |||
315 | add_stat (const struct GNUNET_PeerIdentity *peer, unsigned int route_requests, | 317 | add_stat (const struct GNUNET_PeerIdentity *peer, unsigned int route_requests, |
316 | unsigned int route_forwards, unsigned int result_requests, | 318 | unsigned int route_forwards, unsigned int result_requests, |
317 | unsigned int client_requests, unsigned int result_forwards, | 319 | unsigned int client_requests, unsigned int result_forwards, |
318 | unsigned int gets, unsigned int puts, | 320 | unsigned int gets, unsigned int puts, unsigned int data_inserts, |
319 | unsigned int data_inserts, unsigned int find_peer_requests, | 321 | unsigned int find_peer_requests, unsigned int find_peers_started, |
320 | unsigned int find_peers_started, unsigned int gets_started, | 322 | unsigned int gets_started, unsigned int puts_started, |
321 | unsigned int puts_started, unsigned int find_peer_responses_received, | 323 | unsigned int find_peer_responses_received, |
322 | unsigned int get_responses_received, | 324 | unsigned int get_responses_received, |
323 | unsigned int find_peer_responses_sent, | 325 | unsigned int find_peer_responses_sent, |
324 | unsigned int get_responses_sent) | 326 | unsigned int get_responses_sent) |
@@ -568,9 +570,8 @@ add_query (unsigned long long *sqlqueryuid, unsigned long long queryid, | |||
568 | */ | 570 | */ |
569 | int | 571 | int |
570 | add_route (unsigned long long *sqlqueryuid, unsigned long long queryid, | 572 | add_route (unsigned long long *sqlqueryuid, unsigned long long queryid, |
571 | unsigned int type, unsigned int hops, | 573 | unsigned int type, unsigned int hops, int succeeded, |
572 | int succeeded, const struct GNUNET_PeerIdentity *node, | 574 | const struct GNUNET_PeerIdentity *node, const GNUNET_HashCode * key, |
573 | const GNUNET_HashCode * key, | ||
574 | const struct GNUNET_PeerIdentity *from_node, | 575 | const struct GNUNET_PeerIdentity *from_node, |
575 | const struct GNUNET_PeerIdentity *to_node) | 576 | const struct GNUNET_PeerIdentity *to_node) |
576 | { | 577 | { |
@@ -636,15 +637,15 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
636 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 637 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
637 | "MySQL (DUMP) DHT Logger: initializing\n"); | 638 | "MySQL (DUMP) DHT Logger: initializing\n"); |
638 | 639 | ||
639 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (plugin->cfg, | 640 | if (GNUNET_OK != |
640 | "MYSQLDUMP", "PATH", | 641 | GNUNET_CONFIGURATION_get_value_string (plugin->cfg, "MYSQLDUMP", "PATH", |
641 | &outfile_path)) | 642 | &outfile_path)) |
642 | { | 643 | { |
643 | outfile_path = GNUNET_strdup (""); | 644 | outfile_path = GNUNET_strdup (""); |
644 | } | 645 | } |
645 | 646 | ||
646 | GNUNET_asprintf (&outfile_name, | 647 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump", |
647 | "%s%s-%d", outfile_path, "mysqldump", getpid ()); | 648 | getpid ()); |
648 | 649 | ||
649 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 650 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
650 | 651 | ||
@@ -674,8 +675,8 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
674 | } | 675 | } |
675 | 676 | ||
676 | GNUNET_free (outfile_name); | 677 | GNUNET_free (outfile_name); |
677 | GNUNET_asprintf (&outfile_name, | 678 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_nodes", |
678 | "%s%s-%d", outfile_path, "mysqldump_nodes", getpid ()); | 679 | getpid ()); |
679 | GNUNET_free (fn); | 680 | GNUNET_free (fn); |
680 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 681 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
681 | 682 | ||
@@ -705,8 +706,8 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
705 | } | 706 | } |
706 | 707 | ||
707 | GNUNET_free (outfile_name); | 708 | GNUNET_free (outfile_name); |
708 | GNUNET_asprintf (&outfile_name, | 709 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_routes", |
709 | "%s%s-%d", outfile_path, "mysqldump_routes", getpid ()); | 710 | getpid ()); |
710 | 711 | ||
711 | GNUNET_free (fn); | 712 | GNUNET_free (fn); |
712 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 713 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
@@ -737,8 +738,8 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
737 | } | 738 | } |
738 | 739 | ||
739 | GNUNET_free (outfile_name); | 740 | GNUNET_free (outfile_name); |
740 | GNUNET_asprintf (&outfile_name, | 741 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_queries", |
741 | "%s%s-%d", outfile_path, "mysqldump_queries", getpid ()); | 742 | getpid ()); |
742 | 743 | ||
743 | GNUNET_free (fn); | 744 | GNUNET_free (fn); |
744 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 745 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
@@ -769,8 +770,8 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
769 | } | 770 | } |
770 | 771 | ||
771 | GNUNET_free (outfile_name); | 772 | GNUNET_free (outfile_name); |
772 | GNUNET_asprintf (&outfile_name, | 773 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_stats", |
773 | "%s%s-%d", outfile_path, "mysqldump_stats", getpid ()); | 774 | getpid ()); |
774 | 775 | ||
775 | GNUNET_free (fn); | 776 | GNUNET_free (fn); |
776 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 777 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
@@ -801,9 +802,8 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
801 | } | 802 | } |
802 | 803 | ||
803 | GNUNET_free (outfile_name); | 804 | GNUNET_free (outfile_name); |
804 | GNUNET_asprintf (&outfile_name, | 805 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, |
805 | "%s%s-%d", | 806 | "mysqldump_generic_stats", getpid ()); |
806 | outfile_path, "mysqldump_generic_stats", getpid ()); | ||
807 | GNUNET_free (fn); | 807 | GNUNET_free (fn); |
808 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 808 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
809 | 809 | ||
@@ -833,8 +833,8 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
833 | } | 833 | } |
834 | 834 | ||
835 | GNUNET_free (outfile_name); | 835 | GNUNET_free (outfile_name); |
836 | GNUNET_asprintf (&outfile_name, | 836 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, "mysqldump_dhtkey", |
837 | "%s%s-%d", outfile_path, "mysqldump_dhtkey", getpid ()); | 837 | getpid ()); |
838 | GNUNET_free (fn); | 838 | GNUNET_free (fn); |
839 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 839 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
840 | 840 | ||
@@ -864,9 +864,8 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void *cls) | |||
864 | } | 864 | } |
865 | 865 | ||
866 | GNUNET_free (outfile_name); | 866 | GNUNET_free (outfile_name); |
867 | GNUNET_asprintf (&outfile_name, | 867 | GNUNET_asprintf (&outfile_name, "%s%s-%d", outfile_path, |
868 | "%s%s-%d", | 868 | "mysqldump_extended_topology", getpid ()); |
869 | outfile_path, "mysqldump_extended_topology", getpid ()); | ||
870 | GNUNET_free (fn); | 869 | GNUNET_free (fn); |
871 | fn = GNUNET_STRINGS_filename_expand (outfile_name); | 870 | fn = GNUNET_STRINGS_filename_expand (outfile_name); |
872 | 871 | ||