2 This file is part of GNUnet.
3 (C) 2011, 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
21 * @file nse/gnunet-nse-profiler.c
23 * @brief Profiling driver for the network size estimation service.
24 * Generally, the profiler starts a given number of peers,
25 * then churns some off, waits a certain amount of time, then
26 * churns again, and repeats.
29 * - need to enable user to specify topology options
30 * - need minor fix with "***"-host argument change in TESTBED (TBD there)
31 * - need to check for leaks (especially FD leaks)
35 #include "gnunet_testbed_service.h"
36 #include "gnunet_nse_service.h"
40 * Information we track for a peer in the testbed.
45 * Prev reference in DLL.
50 * Next reference in DLL.
55 * Handle with testbed.
57 struct GNUNET_TESTBED_Peer *daemon;
60 * Testbed operation to connect to NSE service.
62 struct GNUNET_TESTBED_Operation *nse_op;
65 * Handle to statistics service of the peer.
67 struct GNUNET_STATISTICS_Handle *stats;
70 * Testbed operation to connect to statistics service.
72 struct GNUNET_TESTBED_Operation *stats_op;
75 * Task scheduled to get statistics from this peer.
77 GNUNET_SCHEDULER_TaskIdentifier stats_task;
82 * Context for the stats task?
88 * How many messages have peers received during the test.
90 unsigned long long total_nse_received_messages;
93 * How many messages have peers send during the test (should be == received).
95 unsigned long long total_nse_transmitted_messages;
98 * How many messages have travelled an edge in both directions.
100 unsigned long long total_nse_cross;
103 * How many extra messages per edge (corrections) have been received.
105 unsigned long long total_nse_extra;
108 * How many messages have been discarded.
110 unsigned long long total_discarded;
115 * Head of DLL of peers we monitor closely.
117 static struct NSEPeer *peer_head;
120 * Tail of DLL of peers we monitor closely.
122 static struct NSEPeer *peer_tail;
125 * Return value from 'main' (0 == success)
130 * Be verbose (configuration option)
135 * Name of the file with the hosts to run the test over (configuration option)
137 static char *hosts_file;
140 * IP address of this system, as seen by the rest of the system (configuration option)
142 static char *controller_ip;
145 * Maximum number of peers in the test.
147 static unsigned int num_peers;
150 * Total number of rounds to execute.
152 static unsigned int num_rounds;
155 * Current round we are in.
157 static unsigned int current_round;
160 * Array of size 'num_rounds' with the requested number of peers in the given round.
162 static unsigned int *num_peers_in_round;
165 * How many peers are running right now?
167 static unsigned int peers_running;
170 * Specification for the numbers of peers to have in each round.
172 static char *num_peer_spec;
175 * Handles to all of the running peers.
177 static struct GNUNET_TESTBED_Peer **daemons;
180 * Global configuration file
182 static struct GNUNET_CONFIGURATION_Handle *testing_cfg;
185 * Maximum number of connections to NSE services.
187 static unsigned int connection_limit;
190 * Total number of connections in the whole network.
192 static unsigned int total_connections;
195 * File to report results to.
197 static struct GNUNET_DISK_FileHandle *output_file;
200 * Filename to log results to.
202 static char *output_filename;
205 * File to log connection info, statistics to.
207 static struct GNUNET_DISK_FileHandle *data_file;
210 * Filename to log connection info, statistics to.
212 static char *data_filename;
215 * How long to wait before triggering next round?
218 static struct GNUNET_TIME_Relative wait_time = { 60 * 1000 };
221 * How often do we query for statistics during a round?
224 static struct GNUNET_TIME_Relative interval = { 1000 };
227 * Name of the file where we write the topology for each round; NULL for
230 static char *topology_file;
233 * List of hosts we use for the testbed.
235 static struct GNUNET_TESTBED_Host *hosts;
238 * Size of the 'hosts' array.
240 static unsigned int num_hosts;
243 * Handle to the master controller.
245 static struct GNUNET_TESTBED_Controller *controller;
248 * Controller start handle.
250 static struct GNUNET_TESTBED_ControllerProc *copro;
255 static struct GNUNET_TESTBED_Testbed *testbed;
259 * Clean up all of the monitoring connections to NSE and
260 * STATISTICS that we keep to selected peers.
263 close_monitor_connections ()
267 while (NULL != (pos = peer_head))
269 if (NULL != pos->nse_op)
270 GNUNET_TESTBED_operation_done (pos->nse_op);
271 if (NULL != pos->stats_op)
272 GNUNET_TESTBED_operation_done (pos->stats_op);
273 GNUNET_CONTAINER_DLL_remove (peer_head, peer_tail, pos);
274 if (GNUNET_SCHEDULER_NO_TASK != pos->stats_task)
275 GNUNET_SCHEDULER_cancel (pos->stats_task);
282 * Task run on shutdown; cleans up everything.
288 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n");
291 close_monitor_connections ();
293 GNUNET_TESTBED_destroy (testbed);
294 if (NULL != controller)
295 GNUNET_TESTBED_controller_disconnect (controller);
297 GNUNET_TESTBED_controller_stop (copro);
298 while (0 > num_hosts)
299 GNUNET_TESTBED_host_destroy (hosts[--num_hosts]);
300 // FIXME: what about closing other files!?
301 if (NULL != data_file)
302 GNUNET_DISK_file_close (data_file);
307 * Callback to call when network size estimate is updated.
309 * @param cls closure with the 'struct NSEPeer' providing the update
310 * @param timestamp server timestamp
311 * @param estimate the value of the current network size estimate
312 * @param std_dev standard deviation (rounded down to nearest integer)
313 * of the size estimation values seen
317 handle_estimate (void *cls,
318 struct GNUNET_TIME_Absolute timestamp,
319 double estimate, double std_dev)
321 struct NSEPeer *peer = cls;
322 char output_buffer[512];
325 if (NULL == output_file)
328 "Received network size estimate from peer %p. Size: %f std.dev. %f\n",
329 peer, estimate, std_dev);
332 size = GNUNET_snprintf (output_buffer,
333 sizeof (output_buffer),
334 "%p %llu %llu %f %f %f\n",
337 GNUNET_NSE_log_estimate_to_n (estimate), estimate,
339 if (size != GNUNET_DISK_file_write (output_file, output_buffer, size))
340 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
341 "Unable to write to file!\n");
346 * Process core statistic values.
349 * @param subsystem name of subsystem that created the statistic
350 * @param name the name of the datum
351 * @param value the current value
352 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
353 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
356 core_stats_iterator (void *cls, const char *subsystem, const char *name,
357 uint64_t value, int is_persistent)
359 struct NSEPeer *peer = cls;
360 char output_buffer[512];
363 if (NULL == output_file)
365 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
366 "%p -> %s [%s]: %llu\n",
367 peer, subsystem, name, value);
371 GNUNET_snprintf (output_buffer,
372 sizeof (output_buffer),
375 subsystem, name, value);
376 if (size != GNUNET_DISK_file_write (output_file, output_buffer, size))
377 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unable to write to file!\n");
383 * Continuation called by "get_stats" function once we are done.
386 * @param success GNUNET_OK if statistics were
387 * successfully obtained, GNUNET_SYSERR if not.
390 core_stats_cont (void *cls, int success);
394 * Function invoked periodically to get the statistics.
396 * @param cls 'struct NSEPeer' to get stats from
397 * @param tc scheduler context
400 core_get_stats (void *cls,
401 const struct GNUNET_SCHEDULER_TaskContext *tc)
403 struct NSEPeer *peer = cls;
405 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
407 GNUNET_TESTBED_operation_done (peer->stats_op);
409 peer->stats_op = NULL;
412 /* FIXME: code duplication! */
413 GNUNET_STATISTICS_get (peer->stats, "core", NULL,
414 GNUNET_TIME_UNIT_FOREVER_REL,
416 &core_stats_iterator, peer);
417 GNUNET_STATISTICS_get (peer->stats, "transport", NULL,
418 GNUNET_TIME_UNIT_FOREVER_REL,
420 &core_stats_iterator, peer);
421 GNUNET_STATISTICS_get (peer->stats, "nse", NULL,
422 GNUNET_TIME_UNIT_FOREVER_REL,
424 &core_stats_iterator, peer);
425 peer->stats_task = GNUNET_SCHEDULER_NO_TASK;
430 * Continuation called by "get_stats" function.
433 * @param success GNUNET_OK if statistics were
434 * successfully obtained, GNUNET_SYSERR if not.
437 core_stats_cont (void *cls,
440 struct NSEPeer *peer = cls;
442 if (GNUNET_OK != success)
444 peer->stats_task = GNUNET_SCHEDULER_add_delayed (interval,
445 &core_get_stats, peer);
450 * Adapter function called to establish a connection to
451 * statistics service.
454 * @param cfg configuration of the peer to connect to; will be available until
455 * GNUNET_TESTBED_operation_done() is called on the operation returned
456 * from GNUNET_TESTBED_service_connect()
457 * @return service handle to return in 'op_result', NULL on error
460 statistics_connect_adapter (void *cls,
461 const struct GNUNET_CONFIGURATION_Handle *cfg)
463 return GNUNET_STATISTICS_create ("<driver>",
469 * Adapter function called to destroy a connection to
470 * statistics service.
473 * @param op_result service handle returned from the connect adapter
476 statistics_disconnect_adapter (void *cls,
479 GNUNET_STATISTICS_destroy (op_result, GNUNET_NO);
484 * Function called by testbed once we are connected to stats service.
486 * @param cls the 'struct NSEPeer' for which we connected to stats
487 * @param op connect operation handle
488 * @param ca_result handle to stats service
489 * @param emsg error message on failure
493 struct GNUNET_TESTBED_Operation *op,
497 struct NSEPeer *current_peer = cls;
499 if (NULL == ca_result)
501 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
502 "Failed to connect to statistics service: %s\n",
504 GNUNET_SCHEDULER_shutdown ();
507 current_peer->stats = ca_result;
508 GNUNET_STATISTICS_get (current_peer->stats, "core", NULL,
509 GNUNET_TIME_UNIT_FOREVER_REL,
511 &core_stats_iterator, current_peer);
512 GNUNET_STATISTICS_get (current_peer->stats, "transport", NULL,
513 GNUNET_TIME_UNIT_FOREVER_REL,
515 &core_stats_iterator, current_peer);
516 GNUNET_STATISTICS_get (current_peer->stats, "nse", NULL,
517 GNUNET_TIME_UNIT_FOREVER_REL,
519 &core_stats_iterator, current_peer);
524 * Adapter function called to establish a connection to
527 * @param cls closure (the 'struct NSEPeer')
528 * @param cfg configuration of the peer to connect to; will be available until
529 * GNUNET_TESTBED_operation_done() is called on the operation returned
530 * from GNUNET_TESTBED_service_connect()
531 * @return service handle to return in 'op_result', NULL on error
534 nse_connect_adapter (void *cls,
535 const struct GNUNET_CONFIGURATION_Handle *cfg)
537 struct NSEPeer *current_peer = cls;
539 return GNUNET_NSE_connect (cfg, &handle_estimate, current_peer);
544 * Adapter function called to destroy a connection to
548 * @param op_result service handle returned from the connect adapter
551 nse_disconnect_adapter (void *cls,
554 GNUNET_NSE_disconnect (op_result);
559 * Task run to connect to the NSE and statistics services to a subset of
560 * all of the running peers.
562 * @param cls handle the peer
566 connect_nse_service ()
568 struct NSEPeer *current_peer;
571 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to nse service of peers\n");
572 for (i = 0; i < num_peers; i++)
574 if ((connection_limit > 0) &&
575 (num_peers > connection_limit) &&
576 (0 != (i % (num_peers / connection_limit))))
578 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
579 "nse-profiler: connecting to nse service of peer %d\n", i);
580 current_peer = GNUNET_malloc (sizeof (struct NSEPeer));
581 current_peer->daemon = daemons[i];
583 = GNUNET_TESTBED_service_connect (NULL,
584 current_peer->daemon,
587 &nse_connect_adapter,
588 &nse_disconnect_adapter,
590 current_peer->stats_op
591 = GNUNET_TESTBED_service_connect (NULL,
592 current_peer->daemon,
594 &stat_run, current_peer,
595 &statistics_connect_adapter,
596 &statistics_disconnect_adapter,
598 GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer);
604 * Task that starts/stops peers to move to the next round.
606 * @param cls NULL, unused
607 * @param tc scheduler context (unused)
610 next_round (void *cls,
611 const struct GNUNET_SCHEDULER_TaskContext *tc);
615 * Continuation called by the "get_all" and "get" functions at the
616 * end of a round. Obtains the final statistics and writes them to
617 * the file, then either starts the next round, or, if this was the
618 * last round, terminates the run.
620 * @param cls struct StatsContext
621 * @param success GNUNET_OK if statistics were
622 * successfully obtained, GNUNET_SYSERR if not.
625 stats_finished_callback (void *cls,
626 struct GNUNET_TESTBED_Operation *op,
629 struct StatsContext *stats_context = cls;
635 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
636 "Failed to get statistics: %s\n",
638 GNUNET_SCHEDULER_shutdown ();
639 GNUNET_free (stats_context);
642 if (NULL != data_file)
644 /* Stats lookup successful, write out data */
646 GNUNET_snprintf (buf, sizeof (buf),
647 "TOTAL_NSE_RECEIVED_MESSAGES_%u: %u \n",
649 stats_context->total_nse_received_messages);
650 GNUNET_DISK_file_write (data_file, buf, buf_len);
652 GNUNET_snprintf (buf, sizeof (buf),
653 "TOTAL_NSE_TRANSMITTED_MESSAGES_%u: %u\n",
655 stats_context->total_nse_transmitted_messages);
656 GNUNET_DISK_file_write (data_file, buf, buf_len);
658 GNUNET_snprintf (buf, sizeof (buf),
659 "TOTAL_NSE_CROSS_%u: %u \n",
661 stats_context->total_nse_cross);
662 GNUNET_DISK_file_write (data_file, buf, buf_len);
664 GNUNET_snprintf (buf, sizeof (buf),
665 "TOTAL_NSE_EXTRA_%u: %u \n",
667 stats_context->total_nse_extra);
668 GNUNET_DISK_file_write (data_file, buf, buf_len);
670 GNUNET_snprintf (buf, sizeof (buf),
671 "TOTAL_NSE_DISCARDED_%u: %u \n",
673 stats_context->total_discarded);
674 GNUNET_DISK_file_write (data_file, buf, buf_len);
676 GNUNET_SCHEDULER_add_now (&next_round, NULL);
677 GNUNET_free (stats_context);
682 * Callback function to process statistic values.
684 * @param cls struct StatsContext
685 * @param peer the peer the statistics belong to
686 * @param subsystem name of subsystem that created the statistic
687 * @param name the name of the datum
688 * @param value the current value
689 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
690 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
693 statistics_iterator (void *cls,
694 const struct GNUNET_TESTBED_Peer *peer,
695 const char *subsystem, const char *name, uint64_t value,
698 struct StatsContext *stats_context = cls;
702 if (0 != strcmp (subsystem, "nse"))
704 if (0 == strcmp (name, "# flood messages received"))
706 stats_context->total_nse_received_messages += value;
707 if ( (verbose > 1) &&
708 (NULL != data_file) )
711 GNUNET_snprintf (buf, sizeof (buf),
714 GNUNET_DISK_file_write (data_file, buf, buf_len);
717 if (0 == strcmp (name, "# flood messages transmitted"))
719 stats_context->total_nse_transmitted_messages += value;
720 if ( (verbose > 1) &&
721 (NULL != data_file) )
724 GNUNET_snprintf (buf, sizeof (buf),
725 "%p %u TRANSMITTED\n",
727 GNUNET_DISK_file_write (data_file, buf, buf_len);
730 if (0 == strcmp (name, "# cross messages"))
731 stats_context->total_nse_cross += value;
732 if (0 == strcmp (name, "# extra messages"))
733 stats_context->total_nse_extra += value;
734 if (0 == strcmp (name, "# flood messages discarded (clock skew too large)"))
735 stats_context->total_discarded += value;
741 * Function called upon completion of the node start/stop operations
742 * for the current round. Writes the new topology to disk.
747 char temp_output_file[1024];
749 if (NULL != topology_file)
751 GNUNET_snprintf (temp_output_file, sizeof (temp_output_file),
753 topology_file, current_round);
754 GNUNET_TESTBED_overlay_write_topology_to_file (controller,
761 * We're at the end of a round. Stop monitoring, write total
762 * number of connections to log and get full stats. Then trigger
765 * @param cls unused, NULL
769 finish_round (void *cls,
770 const struct GNUNET_SCHEDULER_TaskContext *tc)
772 struct StatsContext *stats_context;
776 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
777 "Have %u connections\n",
779 if (NULL != data_file)
781 buf_len = GNUNET_snprintf (buf, sizeof (buf),
782 "CONNECTIONS_0: %u\n",
784 GNUNET_DISK_file_write (data_file, buf, buf_len);
786 close_monitor_connections ();
787 stats_context = GNUNET_malloc (sizeof (struct StatsContext));
788 GNUNET_TESTBED_get_statistics (num_peers_in_round[current_round],
790 &statistics_iterator,
791 &stats_finished_callback,
797 * We have reached the desired number of peers for the current round.
798 * Run it (by connecting and monitoring a few peers and waiting the
799 * specified delay before finishing the round).
805 connect_nse_service ();
806 GNUNET_SCHEDULER_add_delayed (wait_time,
813 * Task run at the end of a round. Disconnect from all monitored
814 * peers; then get statistics from *all* peers.
816 * @param cls NULL, unused
820 next_round (void *cls,
821 const struct GNUNET_SCHEDULER_TaskContext *tc)
825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnecting nse service of peers\n");
828 if (current_round == num_rounds)
830 /* this was the last round, terminate */
831 GNUNET_SCHEDULER_shutdown ();
834 if (num_peers_in_round[current_round] == peers_running)
836 /* no need to churn, just run next round */
841 /* start peers if we have too few */
842 for (i=peers_running;i<num_peers_in_round[current_round];i++)
843 GNUNET_TESTBED_peer_start (daemons[i], NULL, NULL);
845 /* stop peers if we have too many */
846 for (i=num_peers_in_round[current_round];i<peers_running;i++)
847 GNUNET_TESTBED_peer_stop (daemons[i], NULL, NULL);
852 * Function that will be called whenever something in the
855 * @param cls closure, NULL
856 * @param event information on what is happening
859 master_controller_cb (void *cls,
860 const struct GNUNET_TESTBED_EventInformation *event)
864 case GNUNET_TESTBED_ET_PEER_START:
866 if (num_peers_in_round[current_round] == peers_running)
869 case GNUNET_TESTBED_ET_PEER_STOP:
871 if (num_peers_in_round[current_round] == peers_running)
874 case GNUNET_TESTBED_ET_CONNECT:
876 case GNUNET_TESTBED_ET_DISCONNECT:
885 controller_start_cb (void *cls,
886 const struct GNUNET_CONFIGURATION_Handle *cfg,
889 if (GNUNET_OK != status)
892 GNUNET_SCHEDULER_shutdown ();
895 num_hosts = GNUNET_TESTBED_hosts_load_from_file (hosts_file,
900 "Failed to read host information from `%s'\n",
904 controller = GNUNET_TESTBED_controller_connect (cfg,
907 &master_controller_cb, NULL);
908 testbed = GNUNET_TESTBED_create (controller,
912 0 /* FIXME: topology */,
913 NULL /* FIXME: topology options */);
918 * Actual main function that runs the emulation.
921 * @param args remaining args, unused
922 * @param cfgfile name of the configuration
923 * @param cfg configuration handle
926 run (void *cls, char *const *args, const char *cfgfile,
927 const struct GNUNET_CONFIGURATION_Handle *cfg)
933 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
934 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n");
936 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
937 "use_progressbars", "YES");
938 if (NULL == num_peer_spec)
940 fprintf (stderr, "You need to specify the number of peers to run\n");
943 for (tok = strtok (num_peer_spec, ","); NULL != tok; tok = strtok (NULL, ","))
945 if (1 != sscanf (tok, "%u", &num))
947 fprintf (stderr, "You need to specify numbers, not `%s'\n", tok);
952 fprintf (stderr, "Refusing to run a round with 0 peers\n");
955 GNUNET_array_grow (num_peers_in_round, num_rounds, num);
956 num_peers = GNUNET_MAX (num_peers, num);
960 fprintf (stderr, "Refusing to run a testbed with no rounds\n");
963 daemons = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Peer*) * num_peers);
964 if ( (NULL != data_filename) &&
965 (NULL == (data_file =
966 GNUNET_DISK_file_open (data_filename,
967 GNUNET_DISK_OPEN_READWRITE |
968 GNUNET_DISK_OPEN_TRUNCATE |
969 GNUNET_DISK_OPEN_CREATE,
970 GNUNET_DISK_PERM_USER_READ |
971 GNUNET_DISK_PERM_USER_WRITE))) )
972 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
976 if ( (NULL != output_filename) &&
977 (NULL == (output_file =
978 GNUNET_DISK_file_open (output_filename,
979 GNUNET_DISK_OPEN_READWRITE |
980 GNUNET_DISK_OPEN_CREATE,
981 GNUNET_DISK_PERM_USER_READ |
982 GNUNET_DISK_PERM_USER_WRITE))) )
983 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open",
987 (copro = GNUNET_TESTBED_controller_start (controller_ip, NULL,
989 &controller_start_cb, NULL)))
992 "Failed to start controller\n");
995 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
996 &shutdown_task, NULL);
1003 * @return 0 on success
1006 main (int argc, char *const *argv)
1008 static struct GNUNET_GETOPT_CommandLineOption options[] = {
1009 {'C', "connections", "COUNT",
1010 gettext_noop ("limit to the number of connections to NSE services, 0 for none"),
1011 1, &GNUNET_GETOPT_set_string, &num_peer_spec},
1012 {'d', "details", "FILENAME",
1013 gettext_noop ("name of the file for writing connection information and statistics"),
1014 1, &GNUNET_GETOPT_set_string, &data_filename},
1015 {'H', "hosts", "FILENAME",
1016 gettext_noop ("name of the file with the login information for the testbed"),
1017 1, &GNUNET_GETOPT_set_string, &hosts_file},
1018 {'i', "ip", "CONTROLLER_IP",
1019 gettext_noop ("IP address of this system as seen by the rest of the testbed"),
1020 1, &GNUNET_GETOPT_set_string, &controller_ip},
1021 {'I', "interval", "DELAY",
1022 gettext_noop ("delay between queries to statistics during a round"),
1023 1, &GNUNET_GETOPT_set_relative_time, &interval},
1024 {'t', "topology", "FILENAME",
1025 gettext_noop ("prefix of the filenames we use for writing the topology for each round"),
1026 1, &GNUNET_GETOPT_set_string, &topology_file},
1027 {'o', "output", "FILENAME",
1028 gettext_noop ("name of the file for writing the main results"),
1029 1, &GNUNET_GETOPT_set_string, &output_filename},
1030 {'p', "peers", "NETWORKSIZESPEC",
1031 gettext_noop ("Number of peers to run in each round, separated by commas"),
1032 1, &GNUNET_GETOPT_set_string, &num_peer_spec},
1033 {'V', "verbose", NULL,
1034 gettext_noop ("be verbose (print progress information)"),
1035 0, &GNUNET_GETOPT_increment_value, &verbose},
1036 {'w', "wait", "DELAY",
1037 gettext_noop ("delay between rounds"),
1038 1, &GNUNET_GETOPT_set_relative_time, &wait_time},
1039 GNUNET_GETOPT_OPTION_END
1041 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
1043 GNUNET_log_setup ("nse-profiler", "WARNING", NULL);
1045 GNUNET_PROGRAM_run (argc, argv, "nse-profiler",
1047 ("Measure quality and performance of the NSE service."),
1048 options, &run, NULL))
1053 /* end of nse-profiler.c */