diff options
author | Florian Dold <florian.dold@gmail.com> | 2014-02-03 21:25:53 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2014-02-03 21:25:53 +0000 |
commit | 8a3563b5c242b60aa4b7d2b9a3c3607ef8dcbadb (patch) | |
tree | f4b85c248403ba6783db017930b2258f3e61e18a /src/consensus/gnunet-consensus-profiler.c | |
parent | 694581b42a78419c1c8ffc31ee873484ff93d79b (diff) | |
download | gnunet-8a3563b5c242b60aa4b7d2b9a3c3607ef8dcbadb.tar.gz gnunet-8a3563b5c242b60aa4b7d2b9a3c3607ef8dcbadb.zip |
- consensus and secretsharing have both start time and deadline
Diffstat (limited to 'src/consensus/gnunet-consensus-profiler.c')
-rw-r--r-- | src/consensus/gnunet-consensus-profiler.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/consensus/gnunet-consensus-profiler.c b/src/consensus/gnunet-consensus-profiler.c index 272a675db..d7a14f68e 100644 --- a/src/consensus/gnunet-consensus-profiler.c +++ b/src/consensus/gnunet-consensus-profiler.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
28 | #include "gnunet_time_lib.h" | ||
28 | #include "gnunet_consensus_service.h" | 29 | #include "gnunet_consensus_service.h" |
29 | #include "gnunet_testbed_service.h" | 30 | #include "gnunet_testbed_service.h" |
30 | 31 | ||
@@ -56,6 +57,16 @@ static unsigned *results_for_peer; | |||
56 | 57 | ||
57 | static int verbose; | 58 | static int verbose; |
58 | 59 | ||
60 | /** | ||
61 | * Start time for all consensuses. | ||
62 | */ | ||
63 | static struct GNUNET_TIME_Absolute start; | ||
64 | |||
65 | /** | ||
66 | * Deadline for all consensuses. | ||
67 | */ | ||
68 | static struct GNUNET_TIME_Absolute deadline; | ||
69 | |||
59 | 70 | ||
60 | /** | 71 | /** |
61 | * Signature of the event handler function called by the | 72 | * Signature of the event handler function called by the |
@@ -172,7 +183,6 @@ do_consensus () | |||
172 | 183 | ||
173 | for (i = 0; i < num_peers; i++) | 184 | for (i = 0; i < num_peers; i++) |
174 | GNUNET_CONSENSUS_conclude (consensus_handles[i], | 185 | GNUNET_CONSENSUS_conclude (consensus_handles[i], |
175 | GNUNET_TIME_relative_to_absolute (conclude_timeout), | ||
176 | conclude_cb, &consensus_handles[i]); | 186 | conclude_cb, &consensus_handles[i]); |
177 | } | 187 | } |
178 | 188 | ||
@@ -259,6 +269,8 @@ connect_adapter (void *cls, | |||
259 | consensus = GNUNET_CONSENSUS_create (cfg, | 269 | consensus = GNUNET_CONSENSUS_create (cfg, |
260 | num_peers, peer_ids, | 270 | num_peers, peer_ids, |
261 | &session_id, | 271 | &session_id, |
272 | start, | ||
273 | deadline, | ||
262 | &new_element_cb, chp); | 274 | &new_element_cb, chp); |
263 | *chp = (struct GNUNET_CONSENSUS_Handle *) consensus; | 275 | *chp = (struct GNUNET_CONSENSUS_Handle *) consensus; |
264 | return consensus; | 276 | return consensus; |
@@ -396,6 +408,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
396 | return; | 408 | return; |
397 | } | 409 | } |
398 | 410 | ||
411 | start = GNUNET_TIME_absolute_get (); | ||
412 | deadline = GNUNET_TIME_absolute_add (start, conclude_timeout); | ||
413 | |||
399 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 414 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
400 | "running gnunet-consensus\n"); | 415 | "running gnunet-consensus\n"); |
401 | 416 | ||