fixes
authorChristian Grothoff <christian@grothoff.org>
Fri, 15 Apr 2011 13:27:55 +0000 (13:27 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 15 Apr 2011 13:27:55 +0000 (13:27 +0000)
src/datastore/perf_plugin_datastore.c
src/datastore/plugin_datastore_postgres.c

index 940dd9b972b9cd3b30d65ba296228ab0c5690114..80926bb9f8b27668ba239893de67e0021ae883dd 100644 (file)
@@ -39,7 +39,7 @@
  */
 #define MAX_SIZE 1024LL * 1024 * 128
 
-#define ITERATIONS 10
+#define ITERATIONS 2
 
 /**
  * Number of put operations equivalent to 1/10th of MAX_SIZE
@@ -80,6 +80,7 @@ struct CpsRunContext
   struct GNUNET_DATASTORE_PluginFunctions * api;
   enum RunPhase phase;
   unsigned int cnt;
+  unsigned int iter;
 };
 
 
@@ -199,9 +200,12 @@ iterate_zeros (void *cls,
          GNUNET_break (0);
          crc->phase = RP_ERROR;
        }
-      crc->phase++;
-      crc->cnt = 0;
-      crc->start = GNUNET_TIME_absolute_get ();      
+      else
+       {
+         crc->phase++;
+         crc->cnt = 0;
+         crc->start = GNUNET_TIME_absolute_get ();      
+       }
       GNUNET_SCHEDULER_add_now (&test, crc);
       return GNUNET_OK;
     }
@@ -263,7 +267,10 @@ expiration_get (void *cls,
              (unsigned int) PUT_10);
       GAUGER (category, buf, crc->end.abs_value - crc->start.abs_value, "ms");
       memset (hits, 0, sizeof (hits));
-      crc->phase++;
+      if (++crc->iter == ITERATIONS)
+       crc->phase++;
+      else
+       crc->phase = RP_PUT;
       crc->cnt = 0;      
       crc->start = GNUNET_TIME_absolute_get ();      
     }  
index 2cecfa9a11c6cb7aadd8b70f9beb2597373bd631..aea87fdf40ebe8991f864a41d0b6d99d96e1b6a2 100644 (file)
@@ -998,6 +998,7 @@ postgres_plugin_iter_zero_anonymity (void *cls,
   struct NextRequestClosure *nrc;
 
   nrc = GNUNET_malloc (sizeof (struct NextRequestClosure));
+  nrc->total = UINT32_MAX;
   nrc->btype = htonl ((uint32_t) type);
   nrc->plugin = plugin;
   nrc->iter = iter;
@@ -1125,6 +1126,7 @@ postgres_plugin_replication_get (void *cls,
   rc.iter_cls = iter_cls;
   nrc = GNUNET_malloc (sizeof (struct NextRequestClosure));
   nrc->one_shot = GNUNET_YES;
+  nrc->total = 1;
   nrc->plugin = plugin;
   nrc->iter = &repl_iter;
   nrc->iter_cls = &rc;
@@ -1153,6 +1155,7 @@ postgres_plugin_expiration_get (void *cls,
   btime = GNUNET_htonll (GNUNET_TIME_absolute_get ().abs_value);
   nrc = GNUNET_malloc (sizeof (struct NextRequestClosure));
   nrc->one_shot = GNUNET_YES;
+  nrc->total = 1;
   nrc->plugin = plugin;
   nrc->iter = iter;
   nrc->iter_cls = iter_cls;