aboutsummaryrefslogtreecommitdiff
path: root/src/nse/gnunet-nse-profiler.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-03-26 17:18:21 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-03-26 17:18:21 +0000
commitf7d297d8be140f6507001a509e69bf15d2ea727a (patch)
tree72103e41e493166abb5be03569cd7f93ce8e9d35 /src/nse/gnunet-nse-profiler.c
parent0fb46b5b17698fb04373e55e4130f0635b1bcccc (diff)
downloadgnunet-f7d297d8be140f6507001a509e69bf15d2ea727a.tar.gz
gnunet-f7d297d8be140f6507001a509e69bf15d2ea727a.zip
- request nse statistics only
Diffstat (limited to 'src/nse/gnunet-nse-profiler.c')
-rw-r--r--src/nse/gnunet-nse-profiler.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index 911143b5f..eae5e9670 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -537,37 +537,10 @@ statistics_iterator (void *cls,
537{ 537{
538 struct StatsContext *stats_context = cls; 538 struct StatsContext *stats_context = cls;
539 char buf[512]; 539 char buf[512];
540 const char *const sections[] = {"core", "transport", "nse"};
541 size_t buf_len; 540 size_t buf_len;
542 unsigned int cnt;
543 unsigned int nsections;
544 541
545 nsections = sizeof (sections) / sizeof (char *); 542 if (0 != strcasecmp (subsystem, "nse"))
546 for (cnt = 0; cnt < nsections; cnt++) 543 return GNUNET_SYSERR;
547 if (0 == strcmp (subsystem, sections[cnt]))
548 break;
549 if (cnt == nsections)
550 return GNUNET_OK;
551
552 if (NULL == data_file)
553 {
554 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
555 "%p -> %s [%s]: %llu\n",
556 peer, subsystem, name, value);
557 }
558 else
559 {
560 buf_len =
561 GNUNET_snprintf (buf,
562 sizeof (buf),
563 "%p [%s] %s %llu\n",
564 peer,
565 subsystem, name, value);
566 if (buf_len != GNUNET_DISK_file_write (data_file, buf, buf_len))
567 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unable to write to file!\n");
568 }
569 if (0 != strcmp (subsystem, "nse"))
570 return GNUNET_OK;
571 if (0 == strcmp (name, "# flood messages received")) 544 if (0 == strcmp (name, "# flood messages received"))
572 { 545 {
573 stats_context->total_nse_received_messages += value; 546 stats_context->total_nse_received_messages += value;
@@ -635,7 +608,7 @@ finish_round (void *cls,
635 get_stats_op = 608 get_stats_op =
636 GNUNET_TESTBED_get_statistics (num_peers_in_round[current_round], 609 GNUNET_TESTBED_get_statistics (num_peers_in_round[current_round],
637 daemons, 610 daemons,
638 NULL, NULL, 611 "nse", NULL,
639 &statistics_iterator, 612 &statistics_iterator,
640 &stats_finished_callback, 613 &stats_finished_callback,
641 stats_context); 614 stats_context);