gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14995 - gnunet/src/datastore


From: gnunet
Subject: [GNUnet-SVN] r14995 - gnunet/src/datastore
Date: Fri, 15 Apr 2011 15:27:55 +0200

Author: grothoff
Date: 2011-04-15 15:27:55 +0200 (Fri, 15 Apr 2011)
New Revision: 14995

Modified:
   gnunet/src/datastore/perf_plugin_datastore.c
   gnunet/src/datastore/plugin_datastore_postgres.c
Log:
fixes

Modified: gnunet/src/datastore/perf_plugin_datastore.c
===================================================================
--- gnunet/src/datastore/perf_plugin_datastore.c        2011-04-15 13:16:43 UTC 
(rev 14994)
+++ gnunet/src/datastore/perf_plugin_datastore.c        2011-04-15 13:27:55 UTC 
(rev 14995)
@@ -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 GNUNET_DATASTORE_PluginFunctions * api;
   enum RunPhase phase;
   unsigned int cnt;
+  unsigned int iter;
 };
 
 
@@ -199,9 +200,12 @@
          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 @@
              (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 ();      
     }  

Modified: gnunet/src/datastore/plugin_datastore_postgres.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_postgres.c    2011-04-15 13:16:43 UTC 
(rev 14994)
+++ gnunet/src/datastore/plugin_datastore_postgres.c    2011-04-15 13:27:55 UTC 
(rev 14995)
@@ -998,6 +998,7 @@
   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 @@
   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 @@
   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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]