From 50a297a290c78c7feb0a4918efba82edd019590b Mon Sep 17 00:00:00 2001 From: Timo Dritschler Date: Wed, 10 Dec 2014 15:27:32 +0100 Subject: Fixed KIRO client getting stuck in the RDMA event handler Fix #8: KIRO Server and Client now have routines to handle async communication Fix #6: Added kiro_client_ping_server and respective event handling to server Changed kiro-test-latency to use the new kiro_client_ping_server instead --- test/test-client-latency.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'test') diff --git a/test/test-client-latency.c b/test/test-client-latency.c index d05747d..208c37c 100644 --- a/test/test-client-latency.c +++ b/test/test-client-latency.c @@ -6,7 +6,7 @@ #include -int +int main ( int argc, char *argv[] ) { if (argc < 3) { @@ -15,38 +15,30 @@ main ( int argc, char *argv[] ) } KiroClient *client = kiro_client_new (); - KiroTrb *trb = kiro_trb_new (); if (-1 == kiro_client_connect (client, argv[1], argv[2])) { kiro_client_free (client); return -1; } - kiro_client_sync (client); - kiro_trb_adopt (trb, kiro_client_get_memory (client)); + int iterations = 10000; - GTimer *timer = g_timer_new (); -while (1) { - g_timer_reset (timer); +while (1) { int i = 0; - while(i < 50000) { - kiro_client_sync (client); + float ping_us = 0; + int fail_count = 0; + while(i < iterations) { + float tmp = kiro_client_ping_server (client); + if (tmp < 0) + fail_count++; + else + ping_us += tmp; i++; } - double elapsed = g_timer_elapsed (timer, NULL); - printf ("Average Latency: %fus\n", (elapsed/50000.)*1000*1000); + printf ("Average Latency: %fus\n", ping_us/(float)(iterations - fail_count)); } - g_timer_stop (timer); kiro_client_free (client); - kiro_trb_free (trb); return 0; } - - - - - - - -- cgit v1.2.3