aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-06-06 13:53:41 +0000
committerBart Polot <bart@net.in.tum.de>2012-06-06 13:53:41 +0000
commitb6d376f9b300b042ab9b65ff9a9cfbe5be8bcfbf (patch)
tree0fb4c2f0ca14c01a24dcd8a2206864be36e5e873 /src
parent6122f7a404a27625b1f8cfee149ba225cb8b5ac7 (diff)
downloadgnunet-b6d376f9b300b042ab9b65ff9a9cfbe5be8bcfbf.tar.gz
gnunet-b6d376f9b300b042ab9b65ff9a9cfbe5be8bcfbf.zip
- fix speed test to finish
Diffstat (limited to 'src')
-rw-r--r--src/mesh/test_mesh_small.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c
index 974b63590..ab5d4a9a1 100644
--- a/src/mesh/test_mesh_small.c
+++ b/src/mesh/test_mesh_small.c
@@ -380,7 +380,7 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
380 } 380 }
381 if (test == MULTICAST && peers_responded < 2) 381 if (test == MULTICAST && peers_responded < 2)
382 return GNUNET_OK; 382 return GNUNET_OK;
383 if (test == SPEED_ACK) 383 if (test == SPEED_ACK || test == SPEED)
384 { 384 {
385 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 385 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
386 " received ack %u\n", data_ack); 386 " received ack %u\n", data_ack);
@@ -388,17 +388,17 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
388 GNUNET_TIME_UNIT_FOREVER_REL, sender, 388 GNUNET_TIME_UNIT_FOREVER_REL, sender,
389 sizeof (struct GNUNET_MessageHeader), 389 sizeof (struct GNUNET_MessageHeader),
390 &tmt_rdy, (void *) 1L); 390 &tmt_rdy, (void *) 1L);
391 if (data_ack < 1000) 391 if (data_ack < 1000 && test != SPEED)
392 return GNUNET_OK; 392 return GNUNET_OK;
393 end_time = GNUNET_TIME_absolute_get(); 393 end_time = GNUNET_TIME_absolute_get();
394 total_time = GNUNET_TIME_absolute_get_difference(start_time, end_time); 394 total_time = GNUNET_TIME_absolute_get_difference(start_time, end_time);
395 FPRINTF (stderr, "\nTest time %llu ms\n", 395 FPRINTF (stderr, "\nTest time %llu ms\n",
396 (unsigned long long) total_time.rel_value); 396 (unsigned long long) total_time.rel_value);
397 FPRINTF (stderr, "Test bandwidth: %f kb/s\n", 397 FPRINTF (stderr, "Test bandwidth: %f kb/s\n",
398 4000.0 / total_time.rel_value); 398 4 * 1000.0 / total_time.rel_value); // 4bytes * ms
399 FPRINTF (stderr, "Test throughput: %f packets/s\n", 399 FPRINTF (stderr, "Test throughput: %f packets/s\n\n",
400 1000000.0 / total_time.rel_value); 400 1000.0 * 1000.0 / total_time.rel_value); // 1000 packets * ms
401 GAUGER ("MESH", "Tunnel 5 peers", 1000000.0 / total_time.rel_value, 401 GAUGER ("MESH", "Tunnel 5 peers", 1000.0 * 1000.0 / total_time.rel_value,
402 "packets/s"); 402 "packets/s");
403 } 403 }
404 GNUNET_assert (tunnel == t); 404 GNUNET_assert (tunnel == t);
@@ -412,7 +412,7 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
412 client); 412 client);
413 ok++; 413 ok++;
414 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); 414 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
415 if (SPEED != test) 415 if (SPEED != test || 1002 == ok)
416 { 416 {
417 GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0, 417 GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
418 GNUNET_TIME_UNIT_FOREVER_REL, sender, 418 GNUNET_TIME_UNIT_FOREVER_REL, sender,
@@ -985,13 +985,13 @@ main (int argc, char *argv[])
985 * 1 incoming tunnel (@dest) 985 * 1 incoming tunnel (@dest)
986 * 1 connected peer (@orig) 986 * 1 connected peer (@orig)
987 * 1000 received data packet (@dest) 987 * 1000 received data packet (@dest)
988 * 1received data packet (@orig)
988 * 1 received tunnel destroy (@dest) 989 * 1 received tunnel destroy (@dest)
989 * _________________________________ 990 * _________________________________
990 * 5 x ok expected per peer
991 */ 991 */
992 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n"); 992 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n");
993 test = SPEED; 993 test = SPEED;
994 ok_goal = 1003; 994 ok_goal = 1004;
995 } 995 }
996 else 996 else
997 { 997 {