28#include "gnunet_testbed_service.h"
66 struct GNUNET_TESTBED_Operation *
op,
71 "Error collecting statistics: %s\n",
91 const struct GNUNET_TESTBED_Peer *peer,
102 (
unsigned long long)
value);
121 GNUNET_TESTBED_get_statistics (0, NULL,
157 struct GNUNET_TESTBED_RunHandle *
h,
159 struct GNUNET_TESTBED_Peer **
peers,
160 unsigned int links_succeeded,
161 unsigned int links_failed)
185run (
void *cls,
char *
const *
args,
const char *cfgfile,
204main (
int argc,
char *
const *argv)
211 "run the experiment with COUNT peers"),
218 "specifies name of a file with the HOSTS the testbed should use"),
225 "automatically terminate experiment after DELAY"),
234 "run a testbed to measure file-sharing performance"),
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
struct GNUNET_GETOPT_CommandLineOption options[]
#define gettext_noop(String)
static struct GNUNET_ARM_Operation * op
Current operation.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static struct GNUNET_SCHEDULER_Task * terminate_taskid
Handle to the task run during termination.
static void terminate_task(void *cls)
Task run on shutdown to terminate.
static int process_stats(void *cls, const struct GNUNET_TESTBED_Peer *peer, const char *subsystem, const char *name, uint64_t value, int is_persistent)
Callback function to process statistic values from all peers.
static void timeout_task(void *cls)
Task run on timeout to terminate.
static void test_master(void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int links_succeeded, unsigned int links_failed)
Signature of a main function for a testcase.
static int ret
Final status code.
static struct GNUNET_TIME_Relative timeout
After how long do we abort the test?
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run by the scheduler.
int main(int argc, char *const *argv)
Program to run a file-sharing testbed.
static char * host_filename
Data file with the hosts for the testbed.
static unsigned int num_peers
Number of peers to run in the experiment.
static void shutdown_task(void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
Function called after we've collected the statistics.
static char * name
Name (label) of the records to list.
static char * value
Value of the record to add/remove.
struct GNUNET_CONTAINER_MultiPeerMap * peers
Map from PIDs to struct CadetPeer entries.
static char * subsystem
Set to subsystem that we're going to get stats for (or NULL for all).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_relative_time(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_TIME_Relative *val)
Allow user to specify a struct GNUNET_TIME_Relative (using human-readable "fancy" time).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition of a command line option.
Entry in list of pending tasks.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.