From e71b75575658c435bc77c01ef098336c563af740 Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 30 Sep 2014 14:55:26 +0200 Subject: Fixed a bug in RDMA memory allocation (Size information was missing) Added test-latency and test-bandwith tests --- test/test-client-latency.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/test-client-latency.c (limited to 'test/test-client-latency.c') diff --git a/test/test-client-latency.c b/test/test-client-latency.c new file mode 100644 index 0000000..b50610b --- /dev/null +++ b/test/test-client-latency.c @@ -0,0 +1,52 @@ +#include +#include +#include +#include "kiro-client.h" +#include "kiro-trb.h" +#include + + +int +main ( int argc, char *argv[] ) +{ + if (argc < 3) { + printf ("Not enough aruments. Usage: ./client
\n"); + return -1; + } + + KiroClient *client = kiro_client_new (); + + if (-1 == kiro_client_connect (client, argv[1], argv[2])) { + g_object_unref (client); + return -1; + } + + kiro_client_sync (client); + KiroTrb *trb = kiro_trb_new (); + kiro_trb_adopt (trb, kiro_client_get_memory (client)); + + GTimer *timer = g_timer_new (); +while (1) { + g_timer_reset (timer); + int i = 0; + while(i < 50000) { + kiro_client_sync (client); + i++; + } + + double elapsed = g_timer_elapsed (timer, NULL); + size_t size = kiro_client_get_memory_size (client); + printf ("Average Latency: %fus\n", (elapsed/50000.)*1000*1000); +} + g_timer_stop (timer); + g_object_unref (client); + return 0; +} + + + + + + + + -- cgit v1.2.3