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)
186 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n");
194 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n");
202 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
207 FPRINTF (stderr, "%s", "Ending test.\n");
210 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
212 GNUNET_SCHEDULER_cancel (disconnect_task);
213 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
215 while (NULL != (pos = peer_head))
217 if (pos->nse_handle != NULL)
218 GNUNET_NSE_disconnect (pos->nse_handle);
219 GNUNET_CONTAINER_DLL_remove (peer_head, peer_tail, pos);
220 if (GNUNET_SCHEDULER_NO_TASK != pos->stats_task)
222 GNUNET_SCHEDULER_cancel (pos->stats_task);
223 if (NULL != pos->stats)
224 GNUNET_STATISTICS_destroy(pos->stats, GNUNET_NO);
229 if (data_file != NULL)
230 GNUNET_DISK_file_close (data_file);
231 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
236 * Callback to call when network size estimate is updated.
239 * @param timestamp server timestamp
240 * @param estimate the value of the current network size estimate
241 * @param std_dev standard deviation (rounded down to nearest integer)
242 * of the size estimation values seen
246 handle_estimate (void *cls, struct GNUNET_TIME_Absolute timestamp,
247 double estimate, double std_dev)
249 struct NSEPeer *peer = cls;
253 if (output_file != NULL)
256 GNUNET_asprintf (&output_buffer, "%s %llu %llu %f %f %f\n",
257 GNUNET_i2s (&peer->daemon->id), peers_running,
259 GNUNET_NSE_log_estimate_to_n (estimate), estimate,
261 if (size != GNUNET_DISK_file_write (output_file, output_buffer, size))
262 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unable to write to file!\n");
263 GNUNET_free (output_buffer);
267 "Received network size estimate from peer %s. Size: %f std.dev. %f\n",
268 GNUNET_i2s (&peer->daemon->id), estimate, std_dev);
273 * Process core statistic values.
276 * @param subsystem name of subsystem that created the statistic
277 * @param name the name of the datum
278 * @param value the current value
279 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
280 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
283 core_stats_iterator (void *cls, const char *subsystem, const char *name,
284 uint64_t value, int is_persistent)
286 struct NSEPeer *peer = cls;
290 if (output_file != NULL)
293 GNUNET_asprintf (&output_buffer, "%s [%s] %s %llu\n",
294 GNUNET_i2s (&peer->daemon->id),
295 subsystem, name, value);
296 if (size != GNUNET_DISK_file_write (output_file, output_buffer, size))
297 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unable to write to file!\n");
298 GNUNET_free (output_buffer);
301 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
302 "%s -> %s [%s]: %llu\n",
303 GNUNET_i2s (&peer->daemon->id), subsystem, name, value);
309 * Continuation called by "get_stats" function.
312 * @param success GNUNET_OK if statistics were
313 * successfully obtained, GNUNET_SYSERR if not.
316 core_stats_cont (void *cls, int success);
319 core_get_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
321 struct NSEPeer *peer = cls;
323 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
325 GNUNET_STATISTICS_destroy(peer->stats, GNUNET_NO);
331 GNUNET_STATISTICS_get(peer->stats, "core", NULL,
332 GNUNET_TIME_UNIT_FOREVER_REL,
333 &core_stats_cont, &core_stats_iterator, peer);
334 GNUNET_STATISTICS_get(peer->stats, "transport", NULL,
335 GNUNET_TIME_UNIT_FOREVER_REL,
336 NULL, &core_stats_iterator, peer);
337 GNUNET_STATISTICS_get(peer->stats, "nse", NULL,
338 GNUNET_TIME_UNIT_FOREVER_REL,
339 NULL, &core_stats_iterator, peer);
341 peer->stats_task = GNUNET_SCHEDULER_NO_TASK;
345 * Continuation called by "get_stats" function.
348 * @param success GNUNET_OK if statistics were
349 * successfully obtained, GNUNET_SYSERR if not.
352 core_stats_cont (void *cls, int success)
354 struct NSEPeer *peer = cls;
355 peer->stats_task = GNUNET_SCHEDULER_add_delayed (interval, &core_get_stats,
364 connect_nse_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
366 struct NSEPeer *current_peer;
370 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to nse service of peers\n");
372 for (i = 0; i < num_peers; i++)
374 if ((connection_limit > 0) && (i % (num_peers / connection_limit) != 0))
377 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
378 "nse-profiler: connecting to nse service of peer %d\n", i);
380 current_peer = GNUNET_malloc (sizeof (struct NSEPeer));
381 current_peer->daemon = GNUNET_TESTING_daemon_get (pg, i);
383 GNUNET_TESTING_test_daemon_running (GNUNET_TESTING_daemon_get (pg, i)))
385 current_peer->nse_handle =
386 GNUNET_NSE_connect (current_peer->daemon->cfg, &handle_estimate,
388 GNUNET_assert (current_peer->nse_handle != NULL);
390 current_peer->stats = GNUNET_STATISTICS_create("profiler", current_peer->daemon->cfg);
391 GNUNET_STATISTICS_get(current_peer->stats, "core", NULL,
392 GNUNET_TIME_UNIT_FOREVER_REL,
393 &core_stats_cont, &core_stats_iterator, current_peer);
394 GNUNET_STATISTICS_get(current_peer->stats, "transport", NULL,
395 GNUNET_TIME_UNIT_FOREVER_REL,
396 NULL, &core_stats_iterator, current_peer);
397 GNUNET_STATISTICS_get(current_peer->stats, "nse", NULL,
398 GNUNET_TIME_UNIT_FOREVER_REL,
399 NULL, &core_stats_iterator, current_peer);
400 GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer);
406 churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
410 * Continuation called by the "get_all" and "get" functions.
412 * @param cls struct StatsContext
413 * @param success GNUNET_OK if statistics were
414 * successfully obtained, GNUNET_SYSERR if not.
417 stats_finished_callback (void *cls, int success)
419 struct StatsContext *stats_context = cls;
423 if ((GNUNET_OK == success) && (data_file != NULL))
425 /* Stats lookup successful, write out data */
428 GNUNET_asprintf (&buf, "TOTAL_NSE_RECEIVED_MESSAGES_%d: %u \n",
429 stats_context->shutdown,
430 stats_context->total_nse_received_messages);
433 GNUNET_DISK_file_write (data_file, buf, buf_len);
435 GNUNET_free_non_null (buf);
439 GNUNET_asprintf (&buf, "TOTAL_NSE_TRANSMITTED_MESSAGES_%d: %u\n",
440 stats_context->shutdown,
441 stats_context->total_nse_transmitted_messages);
444 GNUNET_DISK_file_write (data_file, buf, buf_len);
446 GNUNET_free_non_null (buf);
450 GNUNET_asprintf (&buf, "TOTAL_NSE_CROSS_%d: %u \n",
451 stats_context->shutdown,
452 stats_context->total_nse_cross);
455 GNUNET_DISK_file_write (data_file, buf, buf_len);
457 GNUNET_free_non_null (buf);
461 GNUNET_asprintf (&buf, "TOTAL_NSE_EXTRA_%d: %u \n",
462 stats_context->shutdown,
463 stats_context->total_nse_extra);
466 GNUNET_DISK_file_write (data_file, buf, buf_len);
468 GNUNET_free_non_null (buf);
472 GNUNET_asprintf (&buf, "TOTAL_NSE_DISCARDED_%d: %u \n",
473 stats_context->shutdown,
474 stats_context->total_discarded);
477 GNUNET_DISK_file_write (data_file, buf, buf_len);
479 GNUNET_free_non_null (buf);
483 if (GNUNET_YES == stats_context->shutdown)
485 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == shutdown_handle);
486 shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
490 GNUNET_assert (churn_task == GNUNET_SCHEDULER_NO_TASK);
491 churn_task = GNUNET_SCHEDULER_add_now (&churn_peers, NULL);
493 GNUNET_free (stats_context);
498 * Callback function to process statistic values.
500 * @param cls struct StatsContext
501 * @param peer the peer the statistics belong to
502 * @param subsystem name of subsystem that created the statistic
503 * @param name the name of the datum
504 * @param value the current value
505 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
506 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
509 statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer,
510 const char *subsystem, const char *name, uint64_t value,
513 struct StatsContext *stats_context = cls;
515 if (0 == strcmp (subsystem, "nse"))
517 if (0 == strcmp (name, "# flood messages received"))
519 stats_context->total_nse_received_messages += value;
521 if (data_file != NULL)
528 GNUNET_asprintf (&buf, "%s %u RECEIVED\n", GNUNET_i2s(peer), value);
531 GNUNET_DISK_file_write (data_file, buf, buf_len);
533 GNUNET_free_non_null (buf);
537 if (0 == strcmp (name, "# flood messages transmitted"))
539 stats_context->total_nse_transmitted_messages += value;
541 if (data_file != NULL)
548 GNUNET_asprintf (&buf, "%s %u TRANSMITTED\n",
549 GNUNET_i2s(peer), value);
552 GNUNET_DISK_file_write (data_file, buf, buf_len);
554 GNUNET_free_non_null (buf);
558 if (0 == strcmp (name, "# cross messages"))
560 stats_context->total_nse_cross += value;
562 if (0 == strcmp (name, "# extra messages"))
564 stats_context->total_nse_extra += value;
566 if (0 == strcmp (name, "# flood messages discarded (clock skew too large)"))
568 stats_context->total_discarded += value;
576 disconnect_nse_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
580 struct StatsContext *stats_context;
582 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnecting nse service of peers\n");
583 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
584 while (NULL != (pos = peer_head))
586 if (pos->nse_handle != NULL)
588 GNUNET_NSE_disconnect (pos->nse_handle);
589 pos->nse_handle = NULL;
591 GNUNET_CONTAINER_DLL_remove (peer_head, peer_tail, pos);
592 if (NULL != pos->stats)
593 GNUNET_STATISTICS_destroy(pos->stats, GNUNET_NO);
594 if (GNUNET_SCHEDULER_NO_TASK != pos->stats_task)
595 GNUNET_SCHEDULER_cancel (pos->stats_task);
599 GNUNET_asprintf (&buf, "round%llu", current_round);
601 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "nse-profiler", buf,
605 if (current_round == 1)
607 stats_context = GNUNET_malloc (sizeof (struct StatsContext));
608 stats_context->shutdown = GNUNET_NO;
609 GNUNET_TESTING_get_statistics (pg, &stats_finished_callback,
610 &statistics_iterator, stats_context);
614 GNUNET_assert (churn_task == GNUNET_SCHEDULER_NO_TASK);
615 churn_task = GNUNET_SCHEDULER_add_now (&churn_peers, NULL);
618 else /* No more rounds, let's shut it down! */
620 stats_context = GNUNET_malloc (sizeof (struct StatsContext));
621 stats_context->shutdown = GNUNET_YES;
622 GNUNET_SCHEDULER_cancel (shutdown_handle);
623 shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
624 GNUNET_TESTING_get_statistics (pg, &stats_finished_callback,
625 &statistics_iterator, stats_context);
635 * @param emsg NULL on success
638 topology_output_callback (void *cls, const char *emsg)
641 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
642 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
650 * @param emsg NULL on success
653 churn_callback (void *cls, const char *emsg)
655 char *temp_output_file;
657 if (emsg == NULL) /* Everything is okay! */
659 peers_running = peers_next_round;
660 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
661 "Round %llu, churn finished successfully.\n", current_round);
662 GNUNET_assert (disconnect_task == GNUNET_SCHEDULER_NO_TASK);
663 GNUNET_asprintf (&temp_output_file, "%s_%llu.dot", topology_file,
665 GNUNET_TESTING_peergroup_topology_to_file (pg, temp_output_file,
666 &topology_output_callback, NULL);
667 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Writing topology to file %s\n",
669 GNUNET_free (temp_output_file);
673 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Round %llu, churn FAILED!!\n",
675 GNUNET_SCHEDULER_cancel (shutdown_handle);
676 shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
682 churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
684 /* peers_running = GNUNET_TESTING_daemons_running(pg); */
685 churn_task = GNUNET_SCHEDULER_NO_TASK;
686 if (peers_next_round == peers_running)
688 /* Nothing to do... */
689 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
690 GNUNET_assert (disconnect_task == GNUNET_SCHEDULER_NO_TASK);
692 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
693 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Round %lu, doing nothing!\n",
698 if (peers_next_round > num_peers)
700 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
701 "Asked to turn on more peers than we have!!\n");
702 GNUNET_SCHEDULER_cancel (shutdown_handle);
703 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
705 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
706 "Round %llu, turning off %llu peers, turning on %llu peers!\n",
709 peers_next_round) ? peers_running - peers_next_round : 0,
711 peers_running) ? peers_next_round - peers_running : 0);
712 GNUNET_TESTING_daemons_churn (pg, "nse",
714 peers_next_round) ? peers_running -
715 peers_next_round : 0,
717 peers_running) ? peers_next_round -
718 peers_running : 0, wait_time, &churn_callback,
725 nse_started_cb (void *cls, const char *emsg)
727 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
729 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
734 my_cb (void *cls, const char *emsg)
741 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
742 "Peergroup callback called with error, aborting test!\n");
743 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n");
745 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
749 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
750 "Peer Group started successfully, connecting to NSE service for each peer!\n");
752 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Have %u connections\n",
754 if (data_file != NULL)
757 buf_len = GNUNET_asprintf (&buf, "CONNECTIONS_0: %u\n", total_connections);
759 GNUNET_DISK_file_write (data_file, buf, buf_len);
762 peers_running = GNUNET_TESTING_daemons_running (pg);
763 GNUNET_TESTING_daemons_start_service (pg, "nse", wait_time, &nse_started_cb,
770 * Function that will be called whenever two daemons are connected by
771 * the testing library.
774 * @param first peer id for first daemon
775 * @param second peer id for the second daemon
776 * @param distance distance between the connected peers
777 * @param first_cfg config for the first daemon
778 * @param second_cfg config for the second daemon
779 * @param first_daemon handle for the first daemon
780 * @param second_daemon handle for the second daemon
781 * @param emsg error message (NULL on success)
784 connect_cb (void *cls, const struct GNUNET_PeerIdentity *first,
785 const struct GNUNET_PeerIdentity *second, uint32_t distance,
786 const struct GNUNET_CONFIGURATION_Handle *first_cfg,
787 const struct GNUNET_CONFIGURATION_Handle *second_cfg,
788 struct GNUNET_TESTING_Daemon *first_daemon,
789 struct GNUNET_TESTING_Daemon *second_daemon, const char *emsg)
797 run (void *cls, char *const *args, const char *cfgfile,
798 const struct GNUNET_CONFIGURATION_Handle *cfg)
801 struct GNUNET_TESTING_Host *hosts;
805 //testing_cfg = GNUNET_CONFIGURATION_create ();
806 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
808 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n");
809 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
810 "use_progressbars", "YES");
813 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing",
814 "num_peers", &num_peers))
816 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
817 "Option TESTING:NUM_PEERS is required!\n");
822 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "nse-profiler",
823 "WAIT_TIME", &wait_time))
825 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
826 "Option nse-profiler:wait_time is required!\n");
831 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "nse",
832 "INTERVAL", &interval))
834 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
835 "Option nse:interval is required!\n");
840 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "nse-profiler",
844 connection_limit = 0;
848 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
849 "topology_output_file",
852 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
853 "Option nse-profiler:topology_output_file is required!\n");
858 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
863 GNUNET_DISK_file_open (data_filename,
864 GNUNET_DISK_OPEN_READWRITE |
865 GNUNET_DISK_OPEN_TRUNCATE |
866 GNUNET_DISK_OPEN_CREATE,
867 GNUNET_DISK_PERM_USER_READ |
868 GNUNET_DISK_PERM_USER_WRITE);
869 if (data_file == NULL)
870 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
872 GNUNET_free (data_filename);
876 GNUNET_CONFIGURATION_get_value_string (cfg, "nse-profiler", "output_file",
880 GNUNET_DISK_file_open (temp_str,
881 GNUNET_DISK_OPEN_READWRITE |
882 GNUNET_DISK_OPEN_CREATE,
883 GNUNET_DISK_PERM_USER_READ |
884 GNUNET_DISK_PERM_USER_WRITE);
885 if (output_file == NULL)
886 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
889 GNUNET_free_non_null (temp_str);
891 hosts = GNUNET_TESTING_hosts_load (testing_cfg);
893 pg = GNUNET_TESTING_peergroup_start (testing_cfg, num_peers, TIMEOUT,
894 &connect_cb, &my_cb, NULL, hosts);
895 GNUNET_assert (pg != NULL);
897 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
898 &shutdown_task, NULL);
904 * nse-profiler command line options
906 static struct GNUNET_GETOPT_CommandLineOption options[] = {
907 {'V', "verbose", NULL,
908 gettext_noop ("be verbose (print progress information)"),
909 0, &GNUNET_GETOPT_set_one, &verbose},
910 GNUNET_GETOPT_OPTION_END
915 main (int argc, char *argv[])
917 GNUNET_log_setup ("nse-profiler",
924 GNUNET_PROGRAM_run (argc, argv, "nse-profiler",
926 ("Measure quality and performance of the NSE service."),
927 options, &run, NULL);
929 GNUNET_DISK_directory_remove ("/tmp/nse-profiler");
934 /* end of nse-profiler.c */