diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-08-05 13:32:17 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-08-05 13:32:17 +0000 |
commit | 80e91cc2d8e19a1aeead110ac1ac813d85247fd3 (patch) | |
tree | 5a0610b710db07361659aa86d57e64cf4eba1126 /src/ats | |
parent | 72947853f7e945a53b8d8902b0caaaf5f2f8c98a (diff) | |
download | gnunet-80e91cc2d8e19a1aeead110ac1ac813d85247fd3.tar.gz gnunet-80e91cc2d8e19a1aeead110ac1ac813d85247fd3.zip |
confs and makefile
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/Makefile.am | 4 | ||||
-rw-r--r-- | src/ats/perf_ats.c | 47 | ||||
-rw-r--r-- | src/ats/perf_ats_simplistic_bandwidth.conf | 0 | ||||
-rw-r--r-- | src/ats/perf_ats_simplistic_delay.conf | 0 |
4 files changed, 42 insertions, 9 deletions
diff --git a/src/ats/Makefile.am b/src/ats/Makefile.am index 1d9a11518..40450d7f0 100644 --- a/src/ats/Makefile.am +++ b/src/ats/Makefile.am | |||
@@ -264,4 +264,6 @@ perf_ats_simplistic_delay_LDADD = \ | |||
264 | EXTRA_DIST = \ | 264 | EXTRA_DIST = \ |
265 | ats.h \ | 265 | ats.h \ |
266 | test_ats_api.conf \ | 266 | test_ats_api.conf \ |
267 | test_ats_mlp.conf | 267 | test_ats_mlp.conf \ |
268 | perf_ats_simplistic_bandwidth.conf \ | ||
269 | perf_ats_simplistic_delay.conf | ||
diff --git a/src/ats/perf_ats.c b/src/ats/perf_ats.c index 1576361b7..5072c30a5 100644 --- a/src/ats/perf_ats.c +++ b/src/ats/perf_ats.c | |||
@@ -19,19 +19,24 @@ | |||
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file ats/test_ats.c | 21 | * @file ats/test_ats.c |
22 | * @brief ats benchmark | 22 | * @brief ats benchmark: start peers and modify preferences, monitor change over time |
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
24 | * @author Matthias Wachs | 24 | * @author Matthias Wachs |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
28 | 28 | ||
29 | #define TESTNAME_PREFIX "perf_ats_" | ||
30 | |||
29 | static int ret; | 31 | static int ret; |
32 | static char *solver; | ||
33 | static char *preference; | ||
30 | 34 | ||
31 | static void | 35 | static void |
32 | check (void *cls, char *const *args, const char *cfgfile, | 36 | check (void *cls, char *const *args, const char *cfgfile, |
33 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 37 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
34 | { | 38 | { |
39 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Benchmarking solver `%s' on preference `%s'\n"), solver, preference); | ||
35 | ret = 0; | 40 | ret = 0; |
36 | } | 41 | } |
37 | 42 | ||
@@ -39,13 +44,9 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
39 | int | 44 | int |
40 | main (int argc, char *argv[]) | 45 | main (int argc, char *argv[]) |
41 | { | 46 | { |
42 | 47 | char *tmp; | |
43 | static char *const argv2[] = { "perf_ats", | 48 | char *tmp_sep; |
44 | "-c", | 49 | char *conf_name; |
45 | "perf_ats.conf", | ||
46 | "-L", "WARNING", | ||
47 | NULL | ||
48 | }; | ||
49 | 50 | ||
50 | ret = 1; | 51 | ret = 1; |
51 | 52 | ||
@@ -53,10 +54,40 @@ main (int argc, char *argv[]) | |||
53 | GNUNET_GETOPT_OPTION_END | 54 | GNUNET_GETOPT_OPTION_END |
54 | }; | 55 | }; |
55 | 56 | ||
57 | /* figure out testname */ | ||
58 | tmp = strstr (argv[0], TESTNAME_PREFIX); | ||
59 | if (NULL == tmp) | ||
60 | { | ||
61 | fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]); | ||
62 | return GNUNET_SYSERR; | ||
63 | } | ||
64 | tmp += strlen(TESTNAME_PREFIX); | ||
65 | solver = GNUNET_strdup (tmp); | ||
66 | tmp_sep = strchr (solver, '_'); | ||
67 | if (NULL == tmp_sep) | ||
68 | { | ||
69 | fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]); | ||
70 | GNUNET_free (solver); | ||
71 | return GNUNET_SYSERR; | ||
72 | } | ||
73 | tmp_sep[0] = '\0'; | ||
74 | preference = GNUNET_strdup(tmp_sep + 1); | ||
75 | |||
76 | GNUNET_asprintf(&conf_name, "%s%s_%s.conf", TESTNAME_PREFIX, solver, preference); | ||
77 | |||
78 | char *argv2[] = { "perf_ats", | ||
79 | "-c", | ||
80 | conf_name, | ||
81 | "-L", "WARNING", | ||
82 | NULL | ||
83 | }; | ||
56 | GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, | 84 | GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, |
57 | "perf_ats", "nohelp", options, | 85 | "perf_ats", "nohelp", options, |
58 | &check, NULL); | 86 | &check, NULL); |
59 | 87 | ||
88 | GNUNET_free (solver); | ||
89 | GNUNET_free (preference); | ||
90 | GNUNET_free (conf_name); | ||
60 | 91 | ||
61 | return ret; | 92 | return ret; |
62 | } | 93 | } |
diff --git a/src/ats/perf_ats_simplistic_bandwidth.conf b/src/ats/perf_ats_simplistic_bandwidth.conf new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/ats/perf_ats_simplistic_bandwidth.conf | |||
diff --git a/src/ats/perf_ats_simplistic_delay.conf b/src/ats/perf_ats_simplistic_delay.conf new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/ats/perf_ats_simplistic_delay.conf | |||