2 This file is part of GNUnet.
3 (C) 2011 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 #include "gnunet_testing_lib.h"
30 #include "gnunet_nse_service.h"
40 struct GNUNET_TESTING_Daemon *daemon;
42 struct GNUNET_NSE_Handle *nse_handle;
44 struct GNUNET_STATISTICS_Handle *stats;
46 GNUNET_SCHEDULER_TaskIdentifier stats_task;
53 * Whether or not shoutdown after finishing.
58 * How many messages have peers received during the test.
60 unsigned long long total_nse_received_messages;
63 * How many messages have peers send during the test (should be == received).
65 unsigned long long total_nse_transmitted_messages;
68 * How many messages have travelled an edge in both directions.
70 unsigned long long total_nse_cross;
73 * How many extra messages per edge (corrections) have been received.
75 unsigned long long total_nse_extra;
78 * How many messages have been discarded.
80 unsigned long long total_discarded;
84 static struct NSEPeer *peer_head;
86 static struct NSEPeer *peer_tail;
89 * How long until we give up on connecting the peers?
91 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1500)
101 * Total number of peers in the test.
103 static unsigned long long num_peers;
106 * Global configuration file
108 static struct GNUNET_CONFIGURATION_Handle *testing_cfg;
111 * Total number of currently running peers.
113 static unsigned long long peers_running;
116 * Current round we are in.
118 static unsigned long long current_round;
121 * Peers desired in the next round.
123 static unsigned long long peers_next_round;
126 * Maximum number of connections to NSE services.
128 static unsigned long long connection_limit;
131 * Total number of connections in the whole network.
133 static unsigned int total_connections;
136 * The currently running peer group.
138 static struct GNUNET_TESTING_PeerGroup *pg;
141 * File to report results to.
143 static struct GNUNET_DISK_FileHandle *output_file;
146 * File to log connection info, statistics to.
148 static struct GNUNET_DISK_FileHandle *data_file;
151 * How many data points to capture before triggering next round?
153 static struct GNUNET_TIME_Relative wait_time;
158 static struct GNUNET_TIME_Relative interval;
161 * Task called to disconnect peers.
163 static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
166 * Task called to shutdown test.
168 static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
171 * Task used to churn the network.
173 static GNUNET_SCHEDULER_TaskIdentifier churn_task;
175 static char *topology_file;
178 * Check whether peers successfully shut down.
181 shutdown_callback (void *cls, const char *emsg)
185 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n");
191 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n");
198 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
202 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n");
203 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
205 GNUNET_SCHEDULER_cancel (disconnect_task);
206 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
208 while (NULL != (pos = peer_head))
210 if (pos->nse_handle != NULL)
211 GNUNET_NSE_disconnect (pos->nse_handle);
212 GNUNET_CONTAINER_DLL_remove (peer_head, peer_tail, pos);
213 if (GNUNET_SCHEDULER_NO_TASK != pos->stats_task)
215 GNUNET_SCHEDULER_cancel (pos->stats_task);
216 if (NULL != pos->stats)
217 GNUNET_STATISTICS_destroy(pos->stats, GNUNET_NO);
222 if (data_file != NULL)
223 GNUNET_DISK_file_close (data_file);
224 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
229 * Callback to call when network size estimate is updated.
232 * @param timestamp server timestamp
233 * @param estimate the value of the current network size estimate
234 * @param std_dev standard deviation (rounded down to nearest integer)
235 * of the size estimation values seen
239 handle_estimate (void *cls, struct GNUNET_TIME_Absolute timestamp,
240 double estimate, double std_dev)
242 struct NSEPeer *peer = cls;
246 if (output_file != NULL)
249 GNUNET_asprintf (&output_buffer, "%s %llu %llu %f %f %f\n",
250 GNUNET_i2s (&peer->daemon->id), peers_running,
252 GNUNET_NSE_log_estimate_to_n (estimate), estimate,
254 if (size != GNUNET_DISK_file_write (output_file, output_buffer, size))
255 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unable to write to file!\n");
256 GNUNET_free (output_buffer);
260 "Received network size estimate from peer %s. Size: %f std.dev. %f\n",
261 GNUNET_i2s (&peer->daemon->id), estimate, std_dev);
266 * Process core statistic values.
269 * @param subsystem name of subsystem that created the statistic
270 * @param name the name of the datum
271 * @param value the current value
272 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
273 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
276 core_stats_iterator (void *cls, const char *subsystem, const char *name,
277 uint64_t value, int is_persistent)
279 struct NSEPeer *peer = cls;
283 if (output_file != NULL)
286 GNUNET_asprintf (&output_buffer, "%s [%s] %s %llu\n",
287 GNUNET_i2s (&peer->daemon->id),
288 subsystem, name, value);
289 if (size != GNUNET_DISK_file_write (output_file, output_buffer, size))
290 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unable to write to file!\n");
291 GNUNET_free (output_buffer);
294 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
295 "%s -> %s [%s]: %llu\n",
296 GNUNET_i2s (&peer->daemon->id), subsystem, name, value);
302 * Continuation called by "get_stats" function.
305 * @param success GNUNET_OK if statistics were
306 * successfully obtained, GNUNET_SYSERR if not.
309 core_stats_cont (void *cls, int success);
312 core_get_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
314 struct NSEPeer *peer = cls;
316 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
318 GNUNET_STATISTICS_destroy(peer->stats, GNUNET_NO);
324 GNUNET_STATISTICS_get(peer->stats, "core", NULL,
325 GNUNET_TIME_UNIT_FOREVER_REL,
326 &core_stats_cont, &core_stats_iterator, peer);
327 GNUNET_STATISTICS_get(peer->stats, "transport", NULL,
328 GNUNET_TIME_UNIT_FOREVER_REL,
329 NULL, &core_stats_iterator, peer);
330 GNUNET_STATISTICS_get(peer->stats, "nse", NULL,
331 GNUNET_TIME_UNIT_FOREVER_REL,
332 NULL, &core_stats_iterator, peer);
334 peer->stats_task = GNUNET_SCHEDULER_NO_TASK;
338 * Continuation called by "get_stats" function.
341 * @param success GNUNET_OK if statistics were
342 * successfully obtained, GNUNET_SYSERR if not.
345 core_stats_cont (void *cls, int success)
347 struct NSEPeer *peer = cls;
348 peer->stats_task = GNUNET_SCHEDULER_add_delayed (interval, &core_get_stats,
357 connect_nse_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
359 struct NSEPeer *current_peer;
362 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to nse service of peers\n");
363 for (i = 0; i < num_peers; i++)
365 if ((connection_limit > 0) &&
366 (num_peers > connection_limit) &&
367 (i % (num_peers / connection_limit) != 0))
369 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
370 "nse-profiler: connecting to nse service of peer %d\n", i);
371 current_peer = GNUNET_malloc (sizeof (struct NSEPeer));
372 current_peer->daemon = GNUNET_TESTING_daemon_get (pg, i);
374 GNUNET_TESTING_test_daemon_running (GNUNET_TESTING_daemon_get (pg, i)))
376 current_peer->nse_handle =
377 GNUNET_NSE_connect (current_peer->daemon->cfg, &handle_estimate,
379 GNUNET_assert (current_peer->nse_handle != NULL);
381 current_peer->stats = GNUNET_STATISTICS_create("profiler", current_peer->daemon->cfg);
382 GNUNET_STATISTICS_get(current_peer->stats, "core", NULL,
383 GNUNET_TIME_UNIT_FOREVER_REL,
384 &core_stats_cont, &core_stats_iterator, current_peer);
385 GNUNET_STATISTICS_get(current_peer->stats, "transport", NULL,
386 GNUNET_TIME_UNIT_FOREVER_REL,
387 NULL, &core_stats_iterator, current_peer);
388 GNUNET_STATISTICS_get(current_peer->stats, "nse", NULL,
389 GNUNET_TIME_UNIT_FOREVER_REL,
390 NULL, &core_stats_iterator, current_peer);
391 GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer);
397 churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
401 * Continuation called by the "get_all" and "get" functions.
403 * @param cls struct StatsContext
404 * @param success GNUNET_OK if statistics were
405 * successfully obtained, GNUNET_SYSERR if not.
408 stats_finished_callback (void *cls, int success)
410 struct StatsContext *stats_context = cls;
414 if ((GNUNET_OK == success) && (data_file != NULL))
416 /* Stats lookup successful, write out data */
419 GNUNET_asprintf (&buf, "TOTAL_NSE_RECEIVED_MESSAGES_%d: %u \n",
420 stats_context->shutdown,
421 stats_context->total_nse_received_messages);
424 GNUNET_DISK_file_write (data_file, buf, buf_len);
426 GNUNET_free_non_null (buf);
430 GNUNET_asprintf (&buf, "TOTAL_NSE_TRANSMITTED_MESSAGES_%d: %u\n",
431 stats_context->shutdown,
432 stats_context->total_nse_transmitted_messages);
435 GNUNET_DISK_file_write (data_file, buf, buf_len);
437 GNUNET_free_non_null (buf);
441 GNUNET_asprintf (&buf, "TOTAL_NSE_CROSS_%d: %u \n",
442 stats_context->shutdown,
443 stats_context->total_nse_cross);
446 GNUNET_DISK_file_write (data_file, buf, buf_len);
448 GNUNET_free_non_null (buf);
452 GNUNET_asprintf (&buf, "TOTAL_NSE_EXTRA_%d: %u \n",
453 stats_context->shutdown,
454 stats_context->total_nse_extra);
457 GNUNET_DISK_file_write (data_file, buf, buf_len);
459 GNUNET_free_non_null (buf);
463 GNUNET_asprintf (&buf, "TOTAL_NSE_DISCARDED_%d: %u \n",
464 stats_context->shutdown,
465 stats_context->total_discarded);
468 GNUNET_DISK_file_write (data_file, buf, buf_len);
470 GNUNET_free_non_null (buf);
474 if (GNUNET_YES == stats_context->shutdown)
476 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == shutdown_handle);
477 shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
481 GNUNET_assert (churn_task == GNUNET_SCHEDULER_NO_TASK);
482 churn_task = GNUNET_SCHEDULER_add_now (&churn_peers, NULL);
484 GNUNET_free (stats_context);
489 * Callback function to process statistic values.
491 * @param cls struct StatsContext
492 * @param peer the peer the statistics belong to
493 * @param subsystem name of subsystem that created the statistic
494 * @param name the name of the datum
495 * @param value the current value
496 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
497 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
500 statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer,
501 const char *subsystem, const char *name, uint64_t value,
504 struct StatsContext *stats_context = cls;
506 if (0 == strcmp (subsystem, "nse"))
508 if (0 == strcmp (name, "# flood messages received"))
510 stats_context->total_nse_received_messages += value;
512 if (data_file != NULL)
519 GNUNET_asprintf (&buf, "%s %u RECEIVED\n", GNUNET_i2s(peer), value);
522 GNUNET_DISK_file_write (data_file, buf, buf_len);
524 GNUNET_free_non_null (buf);
528 if (0 == strcmp (name, "# flood messages transmitted"))
530 stats_context->total_nse_transmitted_messages += value;
532 if (data_file != NULL)
539 GNUNET_asprintf (&buf, "%s %u TRANSMITTED\n",
540 GNUNET_i2s(peer), value);
543 GNUNET_DISK_file_write (data_file, buf, buf_len);
545 GNUNET_free_non_null (buf);
549 if (0 == strcmp (name, "# cross messages"))
551 stats_context->total_nse_cross += value;
553 if (0 == strcmp (name, "# extra messages"))
555 stats_context->total_nse_extra += value;
557 if (0 == strcmp (name, "# flood messages discarded (clock skew too large)"))
559 stats_context->total_discarded += value;
567 disconnect_nse_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
571 struct StatsContext *stats_context;
573 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnecting nse service of peers\n");
574 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
575 while (NULL != (pos = peer_head))
577 if (pos->nse_handle != NULL)
579 GNUNET_NSE_disconnect (pos->nse_handle);
580 pos->nse_handle = NULL;
582 GNUNET_CONTAINER_DLL_remove (peer_head, peer_tail, pos);
583 if (NULL != pos->stats)
584 GNUNET_STATISTICS_destroy(pos->stats, GNUNET_NO);
585 if (GNUNET_SCHEDULER_NO_TASK != pos->stats_task)
586 GNUNET_SCHEDULER_cancel (pos->stats_task);
590 GNUNET_asprintf (&buf, "round%llu", current_round);
592 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "nse-profiler", buf,
596 if (current_round == 1)
598 stats_context = GNUNET_malloc (sizeof (struct StatsContext));
599 stats_context->shutdown = GNUNET_NO;
600 GNUNET_TESTING_get_statistics (pg, &stats_finished_callback,
601 &statistics_iterator, stats_context);
605 GNUNET_assert (churn_task == GNUNET_SCHEDULER_NO_TASK);
606 churn_task = GNUNET_SCHEDULER_add_now (&churn_peers, NULL);
609 else /* No more rounds, let's shut it down! */
611 stats_context = GNUNET_malloc (sizeof (struct StatsContext));
612 stats_context->shutdown = GNUNET_YES;
613 GNUNET_SCHEDULER_cancel (shutdown_handle);
614 shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
615 GNUNET_TESTING_get_statistics (pg, &stats_finished_callback,
616 &statistics_iterator, stats_context);
626 * @param emsg NULL on success
629 topology_output_callback (void *cls, const char *emsg)
632 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
633 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
641 * @param emsg NULL on success
644 churn_callback (void *cls, const char *emsg)
646 char *temp_output_file;
648 if (emsg == NULL) /* Everything is okay! */
650 peers_running = peers_next_round;
651 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
652 "Round %llu, churn finished successfully.\n", current_round);
653 GNUNET_assert (disconnect_task == GNUNET_SCHEDULER_NO_TASK);
654 GNUNET_asprintf (&temp_output_file, "%s_%llu.dot", topology_file,
656 GNUNET_TESTING_peergroup_topology_to_file (pg, temp_output_file,
657 &topology_output_callback, NULL);
658 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Writing topology to file %s\n",
660 GNUNET_free (temp_output_file);
664 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Round %llu, churn FAILED!!\n",
666 GNUNET_SCHEDULER_cancel (shutdown_handle);
667 shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
673 churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
675 /* peers_running = GNUNET_TESTING_daemons_running(pg); */
676 churn_task = GNUNET_SCHEDULER_NO_TASK;
677 if (peers_next_round == peers_running)
679 /* Nothing to do... */
680 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
681 GNUNET_assert (disconnect_task == GNUNET_SCHEDULER_NO_TASK);
683 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
684 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Round %lu, doing nothing!\n",
689 if (peers_next_round > num_peers)
691 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
692 "Asked to turn on more peers than we have!!\n");
693 GNUNET_SCHEDULER_cancel (shutdown_handle);
694 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
696 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
697 "Round %llu, turning off %llu peers, turning on %llu peers!\n",
700 peers_next_round) ? peers_running - peers_next_round : 0,
702 peers_running) ? peers_next_round - peers_running : 0);
703 GNUNET_TESTING_daemons_churn (pg, "nse",
705 peers_next_round) ? peers_running -
706 peers_next_round : 0,
708 peers_running) ? peers_next_round -
709 peers_running : 0, wait_time, &churn_callback,
716 nse_started_cb (void *cls, const char *emsg)
718 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
720 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
725 my_cb (void *cls, const char *emsg)
732 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
733 "Peergroup callback called with error, aborting test!\n");
734 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n");
736 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
739 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
740 "Peer Group started successfully, connecting to NSE service for each peer!\n");
741 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Have %u connections\n",
743 if (data_file != NULL)
746 buf_len = GNUNET_asprintf (&buf, "CONNECTIONS_0: %u\n", total_connections);
748 GNUNET_DISK_file_write (data_file, buf, buf_len);
751 peers_running = GNUNET_TESTING_daemons_running (pg);
752 GNUNET_TESTING_daemons_start_service (pg, "nse", wait_time, &nse_started_cb,
759 * Function that will be called whenever two daemons are connected by
760 * the testing library.
763 * @param first peer id for first daemon
764 * @param second peer id for the second daemon
765 * @param distance distance between the connected peers
766 * @param first_cfg config for the first daemon
767 * @param second_cfg config for the second daemon
768 * @param first_daemon handle for the first daemon
769 * @param second_daemon handle for the second daemon
770 * @param emsg error message (NULL on success)
773 connect_cb (void *cls, const struct GNUNET_PeerIdentity *first,
774 const struct GNUNET_PeerIdentity *second, uint32_t distance,
775 const struct GNUNET_CONFIGURATION_Handle *first_cfg,
776 const struct GNUNET_CONFIGURATION_Handle *second_cfg,
777 struct GNUNET_TESTING_Daemon *first_daemon,
778 struct GNUNET_TESTING_Daemon *second_daemon, const char *emsg)
786 run (void *cls, char *const *args, const char *cfgfile,
787 const struct GNUNET_CONFIGURATION_Handle *cfg)
790 struct GNUNET_TESTING_Host *hosts;
794 //testing_cfg = GNUNET_CONFIGURATION_create ();
795 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
796 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n");
798 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
799 "use_progressbars", "YES");
802 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing",
803 "num_peers", &num_peers))
805 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
806 "Option TESTING:NUM_PEERS is required!\n");
811 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "nse-profiler",
812 "WAIT_TIME", &wait_time))
814 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
815 "Option nse-profiler:wait_time is required!\n");
820 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "nse",
821 "INTERVAL", &interval))
823 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
824 "Option nse:interval is required!\n");
829 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "nse-profiler",
833 connection_limit = 0;
837 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
838 "topology_output_file",
841 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
842 "Option nse-profiler:topology_output_file is required!\n");
847 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
852 GNUNET_DISK_file_open (data_filename,
853 GNUNET_DISK_OPEN_READWRITE |
854 GNUNET_DISK_OPEN_TRUNCATE |
855 GNUNET_DISK_OPEN_CREATE,
856 GNUNET_DISK_PERM_USER_READ |
857 GNUNET_DISK_PERM_USER_WRITE);
858 if (data_file == NULL)
859 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
861 GNUNET_free (data_filename);
865 GNUNET_CONFIGURATION_get_value_string (cfg, "nse-profiler", "output_file",
869 GNUNET_DISK_file_open (temp_str,
870 GNUNET_DISK_OPEN_READWRITE |
871 GNUNET_DISK_OPEN_CREATE,
872 GNUNET_DISK_PERM_USER_READ |
873 GNUNET_DISK_PERM_USER_WRITE);
874 if (output_file == NULL)
875 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
878 GNUNET_free_non_null (temp_str);
880 hosts = GNUNET_TESTING_hosts_load (testing_cfg);
882 pg = GNUNET_TESTING_peergroup_start (testing_cfg, num_peers, TIMEOUT,
883 &connect_cb, &my_cb, NULL, hosts);
884 GNUNET_assert (pg != NULL);
886 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
887 &shutdown_task, NULL);
893 * nse-profiler command line options
895 static struct GNUNET_GETOPT_CommandLineOption options[] = {
896 {'V', "verbose", NULL,
897 gettext_noop ("be verbose (print progress information)"),
898 0, &GNUNET_GETOPT_set_one, &verbose},
899 GNUNET_GETOPT_OPTION_END
904 main (int argc, char *const *argv)
906 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
909 GNUNET_log_setup ("nse-profiler",
913 GNUNET_PROGRAM_run (argc, argv, "nse-profiler",
915 ("Measure quality and performance of the NSE service."),
916 options, &run, NULL))
919 GNUNET_DISK_directory_remove ("/tmp/nse-profiler");
924 /* end of nse-profiler.c */