Пример #1
0
static void
do_shutdown ()
{
  fprintf (stderr, "Shutdown\n");
  /* timeout */
  if (NULL != l)
  {
    GNUNET_ATS_TEST_logging_stop (l);
    GNUNET_ATS_TEST_logging_clean_up (l);
    l = NULL;
  }

  /* Stop traffic generation */
  GNUNET_ATS_TEST_generate_traffic_stop_all();

  /* Stop all preference generations */
  GNUNET_ATS_TEST_generate_preferences_stop_all ();

  if (NULL != e)
  {
    GNUNET_ATS_TEST_experimentation_stop (e);
    e = NULL;
  }
  GNUNET_ATS_TEST_shutdown_topology ();
}
Пример #2
0
/**
 * Shutdown nicely
 *
 * @param cls NULL
 * @param tc the task context
 */
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{

  if (GNUNET_YES == logging)
    GNUNET_ATS_TEST_logging_clean_up(l);

  shutdown_task = NULL;
  if (NULL != progress_task)
  {
    fprintf (stderr, "0\n");
    GNUNET_SCHEDULER_cancel (progress_task);
  }
  progress_task = NULL;

  evaluate ();
  GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking done\n"));

  GNUNET_ATS_TEST_shutdown_topology();
}
Пример #3
0
static void
experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,int success)
{
  if (GNUNET_OK == success)
    GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment done successful in %s\n",
        GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
  else
    GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment failed \n");
  if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
  {
    GNUNET_SCHEDULER_cancel (timeout_task);
    timeout_task = GNUNET_SCHEDULER_NO_TASK;
  }
  /* Stop logging */
  GNUNET_ATS_TEST_logging_stop (l);

  /* Stop traffic generation */
  GNUNET_ATS_TEST_generate_traffic_stop_all();

  /* Stop all preference generations */
  GNUNET_ATS_TEST_generate_preferences_stop_all ();

  evaluate (duration);
  if (opt_log)
    GNUNET_ATS_TEST_logging_write_to_file(l, opt_exp_file, opt_plot);

  if (NULL != l)
  {
    GNUNET_ATS_TEST_logging_stop (l);
    GNUNET_ATS_TEST_logging_clean_up (l);
    l = NULL;
  }

  /* Clean up experiment */
  GNUNET_ATS_TEST_experimentation_stop (e);
  e = NULL;

  /* Shutdown topology */
  GNUNET_ATS_TEST_shutdown_topology ();
}