wip
[oweals/gnunet.git] / src / peerinfo / perf_peerinfo_api.c
index 1c2f81d76e55436396da0fef0730739d196bcd8f..4691570ebd8ef27a44611e6f61633c5038440c70 100755 (executable)
@@ -32,6 +32,7 @@
 #include "gnunet_program_lib.h"
 #include "gnunet_time_lib.h"
 #include "peerinfo.h"
+#include <gauger.h>
 
 #define START_SERVICE 1
 
@@ -107,7 +108,8 @@ add_peer (size_t i)
 static void
 process (void *cls,
          const struct GNUNET_PeerIdentity *peer,
-         const struct GNUNET_HELLO_Message *hello)
+         const struct GNUNET_HELLO_Message *hello,
+         const char * err_msg)
 {
   if (peer == NULL)
     {
@@ -153,11 +155,13 @@ static int
 check ()
 {
   int ok = 0;
-  char *const argv[] = { "test-peerinfo-hammer",
+  char *const argv[] = { "perf-peerinfo-api",
     "-c",
     "test_peerinfo_api_data.conf",
 #if DEBUG_PEERINFO
     "-L", "DEBUG",
+#else
+    "-L", "ERROR",
 #endif
     NULL
   };
@@ -170,9 +174,12 @@ check ()
                                  "gnunet-service-peerinfo",
 #if DEBUG_PEERINFO
                                  "-L", "DEBUG",
+#else
+                               "-L", "ERROR",
 #endif
                                  "-c", "test_peerinfo_api_data.conf", NULL);
 #endif
+  GNUNET_assert (NULL != proc);
   GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
                       argv, "perf-peerinfo-api", "nohelp",
                       options, &run, &ok);
@@ -180,6 +187,7 @@ check ()
           "Received %u/%u calls before timeout\n",
           numpeers,
           NUM_REQUESTS * NUM_REQUESTS / 2);
+  GAUGER ("PEERINFO", "Peerinfo lookups", numpeers / 30, "peers/s");
 #if START_SERVICE
   if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
     {