[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r28398 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r28398 - gnunet/src/ats |
Date: |
Mon, 5 Aug 2013 15:32:17 +0200 |
Author: wachs
Date: 2013-08-05 15:32:17 +0200 (Mon, 05 Aug 2013)
New Revision: 28398
Added:
gnunet/src/ats/perf_ats_simplistic_bandwidth.conf
gnunet/src/ats/perf_ats_simplistic_delay.conf
Modified:
gnunet/src/ats/Makefile.am
gnunet/src/ats/perf_ats.c
Log:
confs and makefile
Modified: gnunet/src/ats/Makefile.am
===================================================================
--- gnunet/src/ats/Makefile.am 2013-08-05 12:49:28 UTC (rev 28397)
+++ gnunet/src/ats/Makefile.am 2013-08-05 13:32:17 UTC (rev 28398)
@@ -264,4 +264,6 @@
EXTRA_DIST = \
ats.h \
test_ats_api.conf \
- test_ats_mlp.conf
+ test_ats_mlp.conf \
+ perf_ats_simplistic_bandwidth.conf \
+ perf_ats_simplistic_delay.conf
Modified: gnunet/src/ats/perf_ats.c
===================================================================
--- gnunet/src/ats/perf_ats.c 2013-08-05 12:49:28 UTC (rev 28397)
+++ gnunet/src/ats/perf_ats.c 2013-08-05 13:32:17 UTC (rev 28398)
@@ -19,19 +19,24 @@
*/
/**
* @file ats/test_ats.c
- * @brief ats benchmark
+ * @brief ats benchmark: start peers and modify preferences, monitor change
over time
* @author Christian Grothoff
* @author Matthias Wachs
*/
#include "platform.h"
#include "gnunet_util_lib.h"
+#define TESTNAME_PREFIX "perf_ats_"
+
static int ret;
+static char *solver;
+static char *preference;
static void
check (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Benchmarking solver `%s' on
preference `%s'\n"), solver, preference);
ret = 0;
}
@@ -39,24 +44,50 @@
int
main (int argc, char *argv[])
{
+ char *tmp;
+ char *tmp_sep;
+ char *conf_name;
- static char *const argv2[] = { "perf_ats",
- "-c",
- "perf_ats.conf",
- "-L", "WARNING",
- NULL
- };
-
ret = 1;
static struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
+ /* figure out testname */
+ tmp = strstr (argv[0], TESTNAME_PREFIX);
+ if (NULL == tmp)
+ {
+ fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]);
+ return GNUNET_SYSERR;
+ }
+ tmp += strlen(TESTNAME_PREFIX);
+ solver = GNUNET_strdup (tmp);
+ tmp_sep = strchr (solver, '_');
+ if (NULL == tmp_sep)
+ {
+ fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]);
+ GNUNET_free (solver);
+ return GNUNET_SYSERR;
+ }
+ tmp_sep[0] = '\0';
+ preference = GNUNET_strdup(tmp_sep + 1);
+
+ GNUNET_asprintf(&conf_name, "%s%s_%s.conf", TESTNAME_PREFIX, solver,
preference);
+
+ char *argv2[] = { "perf_ats",
+ "-c",
+ conf_name,
+ "-L", "WARNING",
+ NULL
+ };
GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,
"perf_ats", "nohelp", options,
&check, NULL);
+ GNUNET_free (solver);
+ GNUNET_free (preference);
+ GNUNET_free (conf_name);
return ret;
}
Added: gnunet/src/ats/perf_ats_simplistic_bandwidth.conf
===================================================================
Added: gnunet/src/ats/perf_ats_simplistic_delay.conf
===================================================================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r28398 - gnunet/src/ats,
gnunet <=