diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-03-13 15:01:42 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-03-13 15:01:42 +0000 |
commit | 19b2aa3faf0205fd880b0ce0d3a0988b9ae7ee59 (patch) | |
tree | 213ba1c6950f2102fbd646feaf06651823107eac /src | |
parent | 5516effa03143377dab7a839abc8580d249cca85 (diff) | |
download | gnunet-19b2aa3faf0205fd880b0ce0d3a0988b9ae7ee59.tar.gz gnunet-19b2aa3faf0205fd880b0ce0d3a0988b9ae7ee59.zip |
-add info about traffic
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/mesh_profiler.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mesh/mesh_profiler.c b/src/mesh/mesh_profiler.c index 7c74a59ee..679c5621f 100644 --- a/src/mesh/mesh_profiler.c +++ b/src/mesh/mesh_profiler.c | |||
@@ -184,6 +184,21 @@ delay_ms_rnd (unsigned int max) | |||
184 | return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, rnd); | 184 | return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, rnd); |
185 | } | 185 | } |
186 | 186 | ||
187 | |||
188 | /** | ||
189 | * Get the index of a peer in the peers array. | ||
190 | * | ||
191 | * @param peer Peer whose index to get. | ||
192 | * | ||
193 | * @return Index of peer in peers. | ||
194 | */ | ||
195 | static unsigned int | ||
196 | get_index (struct MeshPeer *peer) | ||
197 | { | ||
198 | return peer - peers; | ||
199 | } | ||
200 | |||
201 | |||
187 | /** | 202 | /** |
188 | * Show the results of the test (banwidth acheived) and log them to GAUGER | 203 | * Show the results of the test (banwidth acheived) and log them to GAUGER |
189 | */ | 204 | */ |
@@ -566,7 +581,8 @@ static void | |||
566 | ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 581 | ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
567 | { | 582 | { |
568 | struct MeshPeer *peer = (struct MeshPeer *) cls; | 583 | struct MeshPeer *peer = (struct MeshPeer *) cls; |
569 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending data initializer...\n"); | 584 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u -> %u\n", |
585 | get_index (peer), peer->dest); | ||
570 | 586 | ||
571 | GNUNET_MESH_notify_transmit_ready (peer->ch, GNUNET_NO, | 587 | GNUNET_MESH_notify_transmit_ready (peer->ch, GNUNET_NO, |
572 | GNUNET_TIME_UNIT_FOREVER_REL, | 588 | GNUNET_TIME_UNIT_FOREVER_REL, |
@@ -608,7 +624,7 @@ do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
608 | peers[i].ch = GNUNET_MESH_channel_create (peers[i].mesh, NULL, | 624 | peers[i].ch = GNUNET_MESH_channel_create (peers[i].mesh, NULL, |
609 | &peers[peers[i].dest].id, | 625 | &peers[peers[i].dest].id, |
610 | 1, flags); | 626 | 1, flags); |
611 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u -> %u\n", i, peers[i].dest); | 627 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u => %u\n", i, peers[i].dest); |
612 | peers[i].ping_task = GNUNET_SCHEDULER_add_delayed (delay_ms_rnd(2000), | 628 | peers[i].ping_task = GNUNET_SCHEDULER_add_delayed (delay_ms_rnd(2000), |
613 | &ping, &peers[i]); | 629 | &ping, &peers[i]); |
614 | } | 630 | } |