aboutsummaryrefslogtreecommitdiff
path: root/src/experimentation/test_experimentation_clique.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-05-24 12:27:28 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-05-24 12:27:28 +0000
commit6c1e65fe29f0dbd66b38b6b0b489bd211fab9882 (patch)
tree12b2e3a74494b3dad5647bfa0b54a007cc0bc8ab /src/experimentation/test_experimentation_clique.c
parent0544eb9dddba58527a559800ad399a65f225820f (diff)
downloadgnunet-6c1e65fe29f0dbd66b38b6b0b489bd211fab9882.tar.gz
gnunet-6c1e65fe29f0dbd66b38b6b0b489bd211fab9882.zip
issuer
Diffstat (limited to 'src/experimentation/test_experimentation_clique.c')
-rw-r--r--src/experimentation/test_experimentation_clique.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/experimentation/test_experimentation_clique.c b/src/experimentation/test_experimentation_clique.c
index a71010441..f4a195fb0 100644
--- a/src/experimentation/test_experimentation_clique.c
+++ b/src/experimentation/test_experimentation_clique.c
@@ -85,6 +85,7 @@ struct ExperimentationPeer
85 unsigned int active_nodes; 85 unsigned int active_nodes;
86 unsigned int requested_nodes; 86 unsigned int requested_nodes;
87 unsigned int inactive_nodes; 87 unsigned int inactive_nodes;
88 unsigned int issuer;
88}; 89};
89 90
90 91
@@ -160,18 +161,23 @@ check_end ()
160 unsigned int total_active = 0; 161 unsigned int total_active = 0;
161 unsigned int total_inactive = 0; 162 unsigned int total_inactive = 0;
162 unsigned int total_requested = 0; 163 unsigned int total_requested = 0;
164 unsigned int issuer = 0;
163 165
164 for (peer = 0; peer < NUM_PEERS; peer++) 166 for (peer = 0; peer < NUM_PEERS; peer++)
165 { 167 {
166 total_active += ph[peer].active_nodes; 168 total_active += ph[peer].active_nodes;
167 total_requested += ph[peer].requested_nodes; 169 total_requested += ph[peer].requested_nodes;
168 total_inactive += ph[peer].inactive_nodes; 170 total_inactive += ph[peer].inactive_nodes;
171 if (1 == ph[peer].issuer)
172 issuer ++;
173
169 } 174 }
170 if (last_value < total_active) 175 if (last_value < total_active)
171 fprintf (stderr, "."); 176 fprintf (stderr, ".");
172 177
173 if ((total_active == (NUM_PEERS * (NUM_PEERS -1))) && 178 if ((total_active == (NUM_PEERS * (NUM_PEERS -1))) &&
174 (total_requested == 0) && (total_inactive == 0)) 179 (total_requested == 0) && (total_inactive == 0) &&
180 (issuer == NUM_PEERS))
175 { 181 {
176 fprintf (stderr, "\n"); 182 fprintf (stderr, "\n");
177 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "All %u peers active in a clique\n", NUM_PEERS); 183 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "All %u peers active in a clique\n", NUM_PEERS);
@@ -209,6 +215,11 @@ stat_iterator (void *cls, const char *subsystem, const char *name,
209 { 215 {
210 peer->requested_nodes = value; 216 peer->requested_nodes = value;
211 } 217 }
218 if (0 == strcmp (name, "# issuer"))
219 {
220 peer->issuer = value;
221 }
222
212 check_end (); 223 check_end ();
213 224
214 return GNUNET_OK; 225 return GNUNET_OK;
@@ -246,6 +257,9 @@ stat_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
246 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch 257 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
247 (sh, "experimentation", "# nodes requested", 258 (sh, "experimentation", "# nodes requested",
248 stat_iterator, peer)); 259 stat_iterator, peer));
260 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
261 (sh, "experimentation", "# issuer",
262 stat_iterator, peer));
249} 263}
250 264
251/** 265/**