static void
destroy (void *cls)
{
  struct GNUNET_CONSENSUS_Handle *consensus = cls;

  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
              "destroying consensus\n");
  GNUNET_CONSENSUS_destroy (consensus);
  peers_done++;
  if (peers_done == num_peers)
  {
    unsigned int i;
    for (i = 0; i < num_peers; i++)
      GNUNET_TESTBED_operation_done (testbed_operations[i]);
    for (i = 0; i < num_peers; i++)
      printf ("P%u got %u of %u elements\n",
              i,
              results_for_peer[i],
              num_values);
    if (NULL != statistics_filename)
      statistics_file = fopen (statistics_filename, "w");
    GNUNET_TESTBED_get_statistics (num_peers, peers, NULL, NULL,
                                   statistics_cb,
                                   statistics_done_cb,
                                   NULL);
  }
}
Example #2
0
/**
 * Task run on timeout to terminate.  Triggers printing out
 * all statistics.
 *
 * @param cls NULL
 * @param tc unused
 */
static void
terminate_task (void *cls,
		const struct GNUNET_SCHEDULER_TaskContext *tc)
{
  terminate_taskid = NULL;
  GNUNET_TESTBED_get_statistics (0, NULL,
                                 NULL, NULL,
				 &process_stats,
				 &shutdown_task,
				 NULL);
}
Example #3
0
/**
 * Task run on shutdown to terminate.  Triggers printing out
 * all statistics.
 *
 * @param cls NULL
 */
static void
terminate_task (void *cls)
{
    if (NULL != terminate_taskid)
    {
        GNUNET_SCHEDULER_cancel (terminate_taskid);
        terminate_taskid = NULL;
    }
    GNUNET_TESTBED_get_statistics (0, NULL,
                                   NULL, NULL,
                                   &process_stats,
                                   &shutdown_task,
                                   NULL);
}
Example #4
0
/**
 * Task to gather all statistics.
 *
 * @param cls Closure (NULL).
 */
static void
gather_stats_and_exit (void *cls)
{
  long l = (long) cls;

  disconnect_task = NULL;
  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
	      "gathering statistics from line %d\n",
	      (int) l);
  if (NULL != ch)
  {
    if (NULL != th)
    {
      GNUNET_CADET_notify_transmit_ready_cancel (th);
      th = NULL;
    }
    GNUNET_CADET_channel_destroy (ch);
    ch = NULL;
  }
  stats_op = GNUNET_TESTBED_get_statistics (peers_running, testbed_peers,
                                            "cadet", NULL,
                                            stats_iterator, stats_cont, cls);
}