- minor renamings
[oweals/gnunet.git] / src / datastore / perf_datastore_api.c
index 6b7a73640a3e6c6675a200dc0f1908751bd09b12..90f72d6eec1a3df5671d5b462e069987b1299993 100644 (file)
@@ -36,7 +36,7 @@
 #include "gnunet_util_lib.h"
 #include "gnunet_protocols.h"
 #include "gnunet_datastore_service.h"
-#include "gnunet_testing_lib-new.h"
+#include "gnunet_testing_lib.h"
 #include <gauger.h>
 
 /**
@@ -245,9 +245,9 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 #endif
              "Stored %llu kB / %lluk ops / %llu ops/s\n", stored_bytes / 1024,  /* used size in k */
              stored_ops / 1024, /* total operations (in k) */
-             1000 * stored_ops / (1 +
-                                  GNUNET_TIME_absolute_get_duration
-                                  (start_time).rel_value));
+             1000LL * 1000LL * stored_ops / (1 +
+                                            GNUNET_TIME_absolute_get_duration
+                                            (start_time).rel_value_us));
     crc->phase = RP_PUT;
     crc->j = 0;
     GNUNET_SCHEDULER_add_continuation (&run_continuation, crc,
@@ -257,7 +257,7 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     GNUNET_snprintf (gstr, sizeof (gstr), "DATASTORE-%s", plugin_name);
     if ((crc->i == ITERATIONS) && (stored_ops > 0))
       GAUGER (gstr, "PUT operation duration",
-              GNUNET_TIME_absolute_get_duration (start_time).rel_value /
+              GNUNET_TIME_absolute_get_duration (start_time).rel_value_us / 1000LL /
               stored_ops, "ms/operation");
     GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
     GNUNET_free (crc);
@@ -294,15 +294,16 @@ run_tests (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, c
 
 
 static void
-run (void *cls, 
-     const struct GNUNET_CONFIGURATION_Handle *cfg)
+run (void *cls,
+     const struct GNUNET_CONFIGURATION_Handle *cfg,
+     struct GNUNET_TESTING_Peer *peer)
 {
   struct CpsRunContext *crc;
   static struct GNUNET_HashCode zkey;
 
   datastore = GNUNET_DATASTORE_connect (cfg);
   start_time = GNUNET_TIME_absolute_get ();
-  crc = GNUNET_malloc (sizeof (struct CpsRunContext));
+  crc = GNUNET_new (struct CpsRunContext);
   crc->cfg = cfg;
   crc->phase = RP_PUT;
   if (NULL ==
@@ -333,6 +334,7 @@ main (int argc, char *argv[])
                               &run,
                               NULL))
     return 1;
+  FPRINTF (stderr, "%s", "\n");
   return ok;
 }