[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r36747 - gnunet/src/consensus
From: |
gnunet |
Subject: |
[GNUnet-SVN] r36747 - gnunet/src/consensus |
Date: |
Wed, 9 Dec 2015 15:58:08 +0100 |
Author: dold
Date: 2015-12-09 15:58:08 +0100 (Wed, 09 Dec 2015)
New Revision: 36747
Modified:
gnunet/src/consensus/gnunet-consensus-profiler.c
gnunet/src/consensus/test_consensus.conf
Log:
Statistics log file for consensus profiler.
Modified: gnunet/src/consensus/gnunet-consensus-profiler.c
===================================================================
--- gnunet/src/consensus/gnunet-consensus-profiler.c 2015-12-08 21:54:35 UTC
(rev 36746)
+++ gnunet/src/consensus/gnunet-consensus-profiler.c 2015-12-09 14:58:08 UTC
(rev 36747)
@@ -57,6 +57,10 @@
static unsigned *results_for_peer;
+static char *statistics_filename;
+
+static FILE *statistics_file;
+
static int verbose;
/**
@@ -94,7 +98,8 @@
{
GNUNET_assert (NULL == emsg);
GNUNET_TESTBED_operation_done (op);
- printf ("statistics done\n");
+ if (NULL != statistics_file)
+ fclose (statistics_file);
GNUNET_SCHEDULER_shutdown ();
}
@@ -118,7 +123,10 @@
uint64_t value,
int is_persistent)
{
- printf ("stat P%u: %s/%s=%lu\n", GNUNET_TESTBED_get_index (peer), subsystem,
name, (unsigned long) value);
+ if (NULL != statistics_file)
+ {
+ fprintf (statistics_file, "P%u\t%s\t%s\t%lu\n", GNUNET_TESTBED_get_index
(peer), subsystem, name, (unsigned long) value);
+ }
return GNUNET_OK;
}
@@ -142,6 +150,8 @@
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_db,
@@ -489,6 +499,9 @@
{ 'd', "delay", NULL,
gettext_noop ("delay until consensus starts"),
GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &consensus_delay },
+ { 's', "statistics", NULL,
+ gettext_noop ("write statistics to file"),
+ GNUNET_YES, &GNUNET_GETOPT_set_filename, &statistics_filename },
{ 'V', "verbose", NULL,
gettext_noop ("be more verbose (print received values)"),
GNUNET_NO, &GNUNET_GETOPT_set_one, &verbose },
Modified: gnunet/src/consensus/test_consensus.conf
===================================================================
--- gnunet/src/consensus/test_consensus.conf 2015-12-08 21:54:35 UTC (rev
36746)
+++ gnunet/src/consensus/test_consensus.conf 2015-12-09 14:58:08 UTC (rev
36747)
@@ -1,6 +1,3 @@
-[arm]
-RESOURCE_DIAGNOSTICS = resource.log
-
[PATHS]
GNUNET_TEST_HOME = /tmp/test-consensus/
@@ -13,14 +10,6 @@
#EVIL_SPEC = 0;cram;5/1;cram;3
-# Evil behavior: Peer 0 adds 5 random elements when he is the gradecast leader
-# (every peer gets the same element.
-#EVIL_SPEC = 0;stuff-same;leader;5
-
-# Evil behavior: Peer 0 adds 5 random elements when he is the gradecast leader
-# (every peer gets different elements).
-#EVIL_SPEC = 0;stuff-different;leader;5
-
[arm]
RESOURCE_DIAGNOSTICS = resource.log.${PEERID}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r36747 - gnunet/src/consensus,
gnunet <=