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) &&
375 (num_peers > connection_limit) &&
376 (i % (num_peers / connection_limit) != 0))
379 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
380 "nse-profiler: connecting to nse service of peer %d\n", i);
382 current_peer = GNUNET_malloc (sizeof (struct NSEPeer));
383 current_peer->daemon = GNUNET_TESTING_daemon_get (pg, i);
385 GNUNET_TESTING_test_daemon_running (GNUNET_TESTING_daemon_get (pg, i)))
387 current_peer->nse_handle =
388 GNUNET_NSE_connect (current_peer->daemon->cfg, &handle_estimate,
390 GNUNET_assert (current_peer->nse_handle != NULL);
392 current_peer->stats = GNUNET_STATISTICS_create("profiler", current_peer->daemon->cfg);
393 GNUNET_STATISTICS_get(current_peer->stats, "core", NULL,
394 GNUNET_TIME_UNIT_FOREVER_REL,
395 &core_stats_cont, &core_stats_iterator, current_peer);
396 GNUNET_STATISTICS_get(current_peer->stats, "transport", NULL,
397 GNUNET_TIME_UNIT_FOREVER_REL,
398 NULL, &core_stats_iterator, current_peer);
399 GNUNET_STATISTICS_get(current_peer->stats, "nse", NULL,
400 GNUNET_TIME_UNIT_FOREVER_REL,
401 NULL, &core_stats_iterator, current_peer);
402 GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer);
408 churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
412 * Continuation called by the "get_all" and "get" functions.
414 * @param cls struct StatsContext
415 * @param success GNUNET_OK if statistics were
416 * successfully obtained, GNUNET_SYSERR if not.
419 stats_finished_callback (void *cls, int success)
421 struct StatsContext *stats_context = cls;
425 if ((GNUNET_OK == success) && (data_file != NULL))
427 /* Stats lookup successful, write out data */
430 GNUNET_asprintf (&buf, "TOTAL_NSE_RECEIVED_MESSAGES_%d: %u \n",
431 stats_context->shutdown,
432 stats_context->total_nse_received_messages);
435 GNUNET_DISK_file_write (data_file, buf, buf_len);
437 GNUNET_free_non_null (buf);
441 GNUNET_asprintf (&buf, "TOTAL_NSE_TRANSMITTED_MESSAGES_%d: %u\n",
442 stats_context->shutdown,
443 stats_context->total_nse_transmitted_messages);
446 GNUNET_DISK_file_write (data_file, buf, buf_len);
448 GNUNET_free_non_null (buf);
452 GNUNET_asprintf (&buf, "TOTAL_NSE_CROSS_%d: %u \n",
453 stats_context->shutdown,
454 stats_context->total_nse_cross);
457 GNUNET_DISK_file_write (data_file, buf, buf_len);
459 GNUNET_free_non_null (buf);
463 GNUNET_asprintf (&buf, "TOTAL_NSE_EXTRA_%d: %u \n",
464 stats_context->shutdown,
465 stats_context->total_nse_extra);
468 GNUNET_DISK_file_write (data_file, buf, buf_len);
470 GNUNET_free_non_null (buf);
474 GNUNET_asprintf (&buf, "TOTAL_NSE_DISCARDED_%d: %u \n",
475 stats_context->shutdown,
476 stats_context->total_discarded);
479 GNUNET_DISK_file_write (data_file, buf, buf_len);
481 GNUNET_free_non_null (buf);
485 if (GNUNET_YES == stats_context->shutdown)
487 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == shutdown_handle);
488 shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
492 GNUNET_assert (churn_task == GNUNET_SCHEDULER_NO_TASK);
493 churn_task = GNUNET_SCHEDULER_add_now (&churn_peers, NULL);
495 GNUNET_free (stats_context);
500 * Callback function to process statistic values.
502 * @param cls struct StatsContext
503 * @param peer the peer the statistics belong to
504 * @param subsystem name of subsystem that created the statistic
505 * @param name the name of the datum
506 * @param value the current value
507 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
508 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
511 statistics_iterator (void *cls, const struct GNUNET_PeerIdentity *peer,
512 const char *subsystem, const char *name, uint64_t value,
515 struct StatsContext *stats_context = cls;
517 if (0 == strcmp (subsystem, "nse"))
519 if (0 == strcmp (name, "# flood messages received"))
521 stats_context->total_nse_received_messages += value;
523 if (data_file != NULL)
530 GNUNET_asprintf (&buf, "%s %u RECEIVED\n", GNUNET_i2s(peer), value);
533 GNUNET_DISK_file_write (data_file, buf, buf_len);
535 GNUNET_free_non_null (buf);
539 if (0 == strcmp (name, "# flood messages transmitted"))
541 stats_context->total_nse_transmitted_messages += value;
543 if (data_file != NULL)
550 GNUNET_asprintf (&buf, "%s %u TRANSMITTED\n",
551 GNUNET_i2s(peer), value);
554 GNUNET_DISK_file_write (data_file, buf, buf_len);
556 GNUNET_free_non_null (buf);
560 if (0 == strcmp (name, "# cross messages"))
562 stats_context->total_nse_cross += value;
564 if (0 == strcmp (name, "# extra messages"))
566 stats_context->total_nse_extra += value;
568 if (0 == strcmp (name, "# flood messages discarded (clock skew too large)"))
570 stats_context->total_discarded += value;
578 disconnect_nse_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
582 struct StatsContext *stats_context;
584 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnecting nse service of peers\n");
585 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
586 while (NULL != (pos = peer_head))
588 if (pos->nse_handle != NULL)
590 GNUNET_NSE_disconnect (pos->nse_handle);
591 pos->nse_handle = NULL;
593 GNUNET_CONTAINER_DLL_remove (peer_head, peer_tail, pos);
594 if (NULL != pos->stats)
595 GNUNET_STATISTICS_destroy(pos->stats, GNUNET_NO);
596 if (GNUNET_SCHEDULER_NO_TASK != pos->stats_task)
597 GNUNET_SCHEDULER_cancel (pos->stats_task);
601 GNUNET_asprintf (&buf, "round%llu", current_round);
603 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "nse-profiler", buf,
607 if (current_round == 1)
609 stats_context = GNUNET_malloc (sizeof (struct StatsContext));
610 stats_context->shutdown = GNUNET_NO;
611 GNUNET_TESTING_get_statistics (pg, &stats_finished_callback,
612 &statistics_iterator, stats_context);
616 GNUNET_assert (churn_task == GNUNET_SCHEDULER_NO_TASK);
617 churn_task = GNUNET_SCHEDULER_add_now (&churn_peers, NULL);
620 else /* No more rounds, let's shut it down! */
622 stats_context = GNUNET_malloc (sizeof (struct StatsContext));
623 stats_context->shutdown = GNUNET_YES;
624 GNUNET_SCHEDULER_cancel (shutdown_handle);
625 shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
626 GNUNET_TESTING_get_statistics (pg, &stats_finished_callback,
627 &statistics_iterator, stats_context);
637 * @param emsg NULL on success
640 topology_output_callback (void *cls, const char *emsg)
643 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
644 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
652 * @param emsg NULL on success
655 churn_callback (void *cls, const char *emsg)
657 char *temp_output_file;
659 if (emsg == NULL) /* Everything is okay! */
661 peers_running = peers_next_round;
662 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
663 "Round %llu, churn finished successfully.\n", current_round);
664 GNUNET_assert (disconnect_task == GNUNET_SCHEDULER_NO_TASK);
665 GNUNET_asprintf (&temp_output_file, "%s_%llu.dot", topology_file,
667 GNUNET_TESTING_peergroup_topology_to_file (pg, temp_output_file,
668 &topology_output_callback, NULL);
669 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Writing topology to file %s\n",
671 GNUNET_free (temp_output_file);
675 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Round %llu, churn FAILED!!\n",
677 GNUNET_SCHEDULER_cancel (shutdown_handle);
678 shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
684 churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
686 /* peers_running = GNUNET_TESTING_daemons_running(pg); */
687 churn_task = GNUNET_SCHEDULER_NO_TASK;
688 if (peers_next_round == peers_running)
690 /* Nothing to do... */
691 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
692 GNUNET_assert (disconnect_task == GNUNET_SCHEDULER_NO_TASK);
694 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
695 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Round %lu, doing nothing!\n",
700 if (peers_next_round > num_peers)
702 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
703 "Asked to turn on more peers than we have!!\n");
704 GNUNET_SCHEDULER_cancel (shutdown_handle);
705 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
707 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
708 "Round %llu, turning off %llu peers, turning on %llu peers!\n",
711 peers_next_round) ? peers_running - peers_next_round : 0,
713 peers_running) ? peers_next_round - peers_running : 0);
714 GNUNET_TESTING_daemons_churn (pg, "nse",
716 peers_next_round) ? peers_running -
717 peers_next_round : 0,
719 peers_running) ? peers_next_round -
720 peers_running : 0, wait_time, &churn_callback,
727 nse_started_cb (void *cls, const char *emsg)
729 GNUNET_SCHEDULER_add_now (&connect_nse_service, NULL);
731 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_nse_peers, NULL);
736 my_cb (void *cls, const char *emsg)
743 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
744 "Peergroup callback called with error, aborting test!\n");
745 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n");
747 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
751 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
752 "Peer Group started successfully, connecting to NSE service for each peer!\n");
754 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Have %u connections\n",
756 if (data_file != NULL)
759 buf_len = GNUNET_asprintf (&buf, "CONNECTIONS_0: %u\n", total_connections);
761 GNUNET_DISK_file_write (data_file, buf, buf_len);
764 peers_running = GNUNET_TESTING_daemons_running (pg);
765 GNUNET_TESTING_daemons_start_service (pg, "nse", wait_time, &nse_started_cb,
772 * Function that will be called whenever two daemons are connected by
773 * the testing library.
776 * @param first peer id for first daemon
777 * @param second peer id for the second daemon
778 * @param distance distance between the connected peers
779 * @param first_cfg config for the first daemon
780 * @param second_cfg config for the second daemon
781 * @param first_daemon handle for the first daemon
782 * @param second_daemon handle for the second daemon
783 * @param emsg error message (NULL on success)
786 connect_cb (void *cls, const struct GNUNET_PeerIdentity *first,
787 const struct GNUNET_PeerIdentity *second, uint32_t distance,
788 const struct GNUNET_CONFIGURATION_Handle *first_cfg,
789 const struct GNUNET_CONFIGURATION_Handle *second_cfg,
790 struct GNUNET_TESTING_Daemon *first_daemon,
791 struct GNUNET_TESTING_Daemon *second_daemon, const char *emsg)
799 run (void *cls, char *const *args, const char *cfgfile,
800 const struct GNUNET_CONFIGURATION_Handle *cfg)
803 struct GNUNET_TESTING_Host *hosts;
807 //testing_cfg = GNUNET_CONFIGURATION_create ();
808 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
810 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n");
811 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
812 "use_progressbars", "YES");
815 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing",
816 "num_peers", &num_peers))
818 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
819 "Option TESTING:NUM_PEERS is required!\n");
824 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "nse-profiler",
825 "WAIT_TIME", &wait_time))
827 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
828 "Option nse-profiler:wait_time is required!\n");
833 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "nse",
834 "INTERVAL", &interval))
836 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
837 "Option nse:interval is required!\n");
842 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "nse-profiler",
846 connection_limit = 0;
850 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
851 "topology_output_file",
854 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
855 "Option nse-profiler:topology_output_file is required!\n");
860 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
865 GNUNET_DISK_file_open (data_filename,
866 GNUNET_DISK_OPEN_READWRITE |
867 GNUNET_DISK_OPEN_TRUNCATE |
868 GNUNET_DISK_OPEN_CREATE,
869 GNUNET_DISK_PERM_USER_READ |
870 GNUNET_DISK_PERM_USER_WRITE);
871 if (data_file == NULL)
872 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
874 GNUNET_free (data_filename);
878 GNUNET_CONFIGURATION_get_value_string (cfg, "nse-profiler", "output_file",
882 GNUNET_DISK_file_open (temp_str,
883 GNUNET_DISK_OPEN_READWRITE |
884 GNUNET_DISK_OPEN_CREATE,
885 GNUNET_DISK_PERM_USER_READ |
886 GNUNET_DISK_PERM_USER_WRITE);
887 if (output_file == NULL)
888 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
891 GNUNET_free_non_null (temp_str);
893 hosts = GNUNET_TESTING_hosts_load (testing_cfg);
895 pg = GNUNET_TESTING_peergroup_start (testing_cfg, num_peers, TIMEOUT,
896 &connect_cb, &my_cb, NULL, hosts);
897 GNUNET_assert (pg != NULL);
899 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
900 &shutdown_task, NULL);
906 * nse-profiler command line options
908 static struct GNUNET_GETOPT_CommandLineOption options[] = {
909 {'V', "verbose", NULL,
910 gettext_noop ("be verbose (print progress information)"),
911 0, &GNUNET_GETOPT_set_one, &verbose},
912 GNUNET_GETOPT_OPTION_END
917 main (int argc, char *argv[])
919 GNUNET_log_setup ("nse-profiler",
926 GNUNET_PROGRAM_run (argc, argv, "nse-profiler",
928 ("Measure quality and performance of the NSE service."),
929 options, &run, NULL);
931 GNUNET_DISK_directory_remove ("/tmp/nse-profiler");
936 /* end of nse-profiler.c */