aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Szengel <gnunet@maxsz.de>2012-10-30 22:26:14 +0000
committerMaximilian Szengel <gnunet@maxsz.de>2012-10-30 22:26:14 +0000
commitffd5a94b3b06d113f5d6a504d5aa5f4dfbe06d68 (patch)
tree214606307a9ed9862365abe94649a329fe203742
parent9df886ed8497002e564ba018d7ceab36bfd04ddd (diff)
downloadgnunet-ffd5a94b3b06d113f5d6a504d5aa5f4dfbe06d68.tar.gz
gnunet-ffd5a94b3b06d113f5d6a504d5aa5f4dfbe06d68.zip
mesh regex profiler
-rw-r--r--src/mesh/gnunet-regex-profiler.c47
-rw-r--r--src/mesh/gnunet-service-mesh.c2
-rw-r--r--src/mesh/regex_profiler_test.conf16
3 files changed, 32 insertions, 33 deletions
diff --git a/src/mesh/gnunet-regex-profiler.c b/src/mesh/gnunet-regex-profiler.c
index 97ca84ee4..7d1ad1035 100644
--- a/src/mesh/gnunet-regex-profiler.c
+++ b/src/mesh/gnunet-regex-profiler.c
@@ -354,16 +354,6 @@ static char *data_filename;
354static unsigned int max_path_compression; 354static unsigned int max_path_compression;
355 355
356/** 356/**
357 * Announce delay between regex announcing.
358 */
359static struct GNUNET_TIME_Relative announce_delay = { 10000 };
360
361/**
362 * Concurrent announce batch size.
363 */
364static unsigned int announce_batch_size;
365
366/**
367 * Delay before setting mesh service op as done. 357 * Delay before setting mesh service op as done.
368 */ 358 */
369static struct GNUNET_TIME_Relative mesh_done_delay = { 1000 }; 359static struct GNUNET_TIME_Relative mesh_done_delay = { 1000 };
@@ -1158,13 +1148,16 @@ peer_churn_cb (void *cls, const char *emsg)
1158 linking_factor = 1; 1148 linking_factor = 1;
1159 num_links = linking_factor * num_peers; 1149 num_links = linking_factor * num_peers;
1160 */ 1150 */
1161 num_links = num_peers - 1; 1151 /* num_links = num_peers - 1; */
1152 num_links = linking_factor;
1162 state = STATE_PEERS_LINKING; 1153 state = STATE_PEERS_LINKING;
1163 /* Do overlay connect */ 1154 /* Do overlay connect */
1164 prof_start_time = GNUNET_TIME_absolute_get (); 1155 prof_start_time = GNUNET_TIME_absolute_get ();
1165 topology_op = 1156 topology_op =
1166 GNUNET_TESTBED_overlay_configure_topology (NULL, num_peers, peer_handles, 1157 GNUNET_TESTBED_overlay_configure_topology (NULL, num_peers, peer_handles,
1167 GNUNET_TESTBED_TOPOLOGY_LINE, 1158 GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI,
1159 num_links,
1160 GNUNET_TESTBED_TOPOLOGY_DISABLE_AUTO_RETRY,
1168 GNUNET_TESTBED_TOPOLOGY_OPTION_END); 1161 GNUNET_TESTBED_TOPOLOGY_OPTION_END);
1169 if (NULL == topology_op) 1162 if (NULL == topology_op)
1170 { 1163 {
@@ -1377,7 +1370,7 @@ controller_event_cb (void *cls,
1377 } 1370 }
1378 } 1371 }
1379 /* We do no retries, consider this link as established */ 1372 /* We do no retries, consider this link as established */
1380 break; 1373 /* break; */
1381 case GNUNET_TESTBED_ET_CONNECT: 1374 case GNUNET_TESTBED_ET_CONNECT:
1382 { 1375 {
1383 char output_buffer[512]; 1376 char output_buffer[512];
@@ -1589,7 +1582,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int stat
1589 * @return number of strings found in the file. GNUNET_SYSERR on error. 1582 * @return number of strings found in the file. GNUNET_SYSERR on error.
1590 */ 1583 */
1591static int 1584static int
1592load_search_strings (const char *filename, char ***strings) 1585load_search_strings (const char *filename, char ***strings, unsigned int limit)
1593{ 1586{
1594 char *data; 1587 char *data;
1595 char *buf; 1588 char *buf;
@@ -1627,7 +1620,7 @@ load_search_strings (const char *filename, char ***strings)
1627 buf = data; 1620 buf = data;
1628 offset = 0; 1621 offset = 0;
1629 str_cnt = 0; 1622 str_cnt = 0;
1630 while (offset < (filesize - 1)) 1623 while (offset < (filesize - 1) && str_cnt < limit)
1631 { 1624 {
1632 offset++; 1625 offset++;
1633 if (((data[offset] == '\n')) && (buf != &data[offset])) 1626 if (((data[offset] == '\n')) && (buf != &data[offset]))
@@ -1726,7 +1719,12 @@ run (void *cls, char *const *args, const char *cfgfile,
1726 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 1719 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
1727 return; 1720 return;
1728 } 1721 }
1729 num_search_strings = load_search_strings (args[2], &search_strings); 1722 if (num_search_strings != load_search_strings (args[2], &search_strings, num_search_strings))
1723 {
1724 fprintf (stderr, _("Error loading search strings. Given file does not contain enough strings. Exiting.\n"));
1725 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
1726 return;
1727 }
1730 if (0 >= num_search_strings || NULL == search_strings) 1728 if (0 >= num_search_strings || NULL == search_strings)
1731 { 1729 {
1732 fprintf (stderr, _("Error loading search strings. Exiting.\n")); 1730 fprintf (stderr, _("Error loading search strings. Exiting.\n"));
@@ -1765,27 +1763,24 @@ main (int argc, char *const *argv)
1765 {'d', "details", "FILENAME", 1763 {'d', "details", "FILENAME",
1766 gettext_noop ("name of the file for writing statistics"), 1764 gettext_noop ("name of the file for writing statistics"),
1767 1, &GNUNET_GETOPT_set_string, &data_filename}, 1765 1, &GNUNET_GETOPT_set_string, &data_filename},
1768 { 'n', "linking-factor", "FACTOR", 1766 {'n', "linking-factor", "FACTOR",
1769 gettext_noop ("create FACTOR times number of peers random links"), 1767 gettext_noop ("create FACTOR times number of peers random links"),
1770 GNUNET_YES, &GNUNET_GETOPT_set_uint, &linking_factor }, 1768 GNUNET_YES, &GNUNET_GETOPT_set_uint, &linking_factor },
1771 { 'e', "num-errors", "COUNT", 1769 {'e', "num-errors", "COUNT",
1772 gettext_noop ("tolerate COUNT number of continious timeout failures"), 1770 gettext_noop ("tolerate COUNT number of continious timeout failures"),
1773 GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails }, 1771 GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails },
1774 { 't', "matching-timeout", "TIMEOUT", 1772 {'t', "matching-timeout", "TIMEOUT",
1775 gettext_noop ("wait TIMEOUT before considering a string match as failed"), 1773 gettext_noop ("wait TIMEOUT before considering a string match as failed"),
1776 GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &search_timeout }, 1774 GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &search_timeout },
1777 { 's', "search-delay", "DELAY", 1775 {'s', "search-delay", "DELAY",
1778 gettext_noop ("wait DELAY before starting string search"), 1776 gettext_noop ("wait DELAY before starting string search"),
1779 GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &search_delay }, 1777 GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &search_delay },
1778 {'a', "num-search-strings", "COUNT",
1779 gettext_noop ("number of search strings to read from search strings file"),
1780 GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_search_strings },
1780 {'p', "max-path-compression", "MAX_PATH_COMPRESSION", 1781 {'p', "max-path-compression", "MAX_PATH_COMPRESSION",
1781 gettext_noop ("maximum path compression length"), 1782 gettext_noop ("maximum path compression length"),
1782 1, &GNUNET_GETOPT_set_uint, &max_path_compression}, 1783 1, &GNUNET_GETOPT_set_uint, &max_path_compression},
1783 {'a', "announce-delay", "DELAY",
1784 gettext_noop ("wait DELAY between announcing regexes"),
1785 1, &GNUNET_GETOPT_set_relative_time, &announce_delay},
1786 {'b', "announce-batch", "SIZE",
1787 gettext_noop ("number of peers that should announce regexes concurrently"),
1788 1, &GNUNET_GETOPT_set_uint, &announce_batch_size},
1789 GNUNET_GETOPT_OPTION_END 1784 GNUNET_GETOPT_OPTION_END
1790 }; 1785 };
1791 int ret; 1786 int ret;
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 1030fec59..dba4116cf 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -6544,6 +6544,8 @@ handle_local_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
6544 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " (SERVER DOWN)\n"); 6544 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " (SERVER DOWN)\n");
6545 return; 6545 return;
6546 } 6546 }
6547
6548 return;
6547 c = clients; 6549 c = clients;
6548 while (NULL != c) 6550 while (NULL != c)
6549 { 6551 {
diff --git a/src/mesh/regex_profiler_test.conf b/src/mesh/regex_profiler_test.conf
index 1060ccdfc..ebbc9ee2f 100644
--- a/src/mesh/regex_profiler_test.conf
+++ b/src/mesh/regex_profiler_test.conf
@@ -3,16 +3,17 @@ AUTOSTART = NO
3PORT = 12000 3PORT = 12000
4ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24; 4ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24;
5HOSTNAME = localhost 5HOSTNAME = localhost
6MAX_PARALLEL_OVERLAY_CONNECT_OPERATIONS = 200 6MAX_PARALLEL_OVERLAY_CONNECT_OPERATIONS = 20
7MAX_PARALLEL_OPERATIONS = 10000 7MAX_PARALLEL_OPERATIONS = 1000
8MAX_PARALLEL_SERVICE_CONNECTIONS = 10000 8MAX_PARALLEL_SERVICE_CONNECTIONS = 1000
9MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 50
9 10
10[mesh] 11[mesh]
11AUTOSTART = YES 12AUTOSTART = YES
12ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24; 13ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24;
13APP_ANNOUNCE_TIME = 30 s 14APP_ANNOUNCE_TIME = 100 s
14ID_ANNOUNCE_TIME = 30 s 15ID_ANNOUNCE_TIME = 100 s
15CONNECT_TIMEOUT = 60 s 16CONNECT_TIMEOUT = 200 s
16PORT = 12001 17PORT = 12001
17 18
18[dht] 19[dht]
@@ -20,9 +21,10 @@ AUTOSTART = YES
20ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24; 21ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24;
21PORT = 12002 22PORT = 12002
22HOSTNAME = localhost 23HOSTNAME = localhost
24DISABLE_TRY_CONNECT = YES
23 25
24[arm] 26[arm]
25DEFAULTSERVICES = core dht mesh statistics 27DEFAULTSERVICES = core mesh dht statistics
26PORT = 12003 28PORT = 12003
27DEBUG = NO 29DEBUG = NO
28 30