gaugering
authorChristian Grothoff <christian@grothoff.org>
Fri, 18 Feb 2011 18:57:43 +0000 (18:57 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 18 Feb 2011 18:57:43 +0000 (18:57 +0000)
src/datastore/perf_datastore_api.c

index 301124878e0c9b5e9a87045b16c5228ce2173c87..6aee1f725d078fdea8250ffd457a23c3e3c424c9 100644 (file)
@@ -242,6 +242,7 @@ run_continuation (void *cls,
   static char data[65536];
   int i;
   int k;
+  char gstr[128];
 
   ok = (int) crc->phase;
   switch (crc->phase)
@@ -293,11 +294,18 @@ run_continuation (void *cls,
                1000 * stored_ops / (1 + GNUNET_TIME_absolute_get_duration(start_time).rel_value));
       crc->phase = RP_PUT;
       crc->j = 0;
+      start = GNUNET_TIME_absolute_get ();
       GNUNET_SCHEDULER_add_continuation (&run_continuation,
                                         crc,
                                         GNUNET_SCHEDULER_REASON_PREREQ_DONE);
       break;
     case RP_DONE:
+      GNUNET_snprintf (gstr, sizeof (gstr),
+                      "PUT operations in %s-datastore_op/s",
+                      plugins_name);
+      if (crc->i == ITERATIONS)
+       GAUGER (1000 * stored_ops / (1 + GNUNET_TIME_absolute_get_duration(start_time).rel_value),
+               gstr);  
       GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
       GNUNET_free (crc);
       ok = 0;