gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r8741 - gnunet/src/datastore
Date: Fri, 17 Jul 2009 16:43:42 -0600

Author: grothoff
Date: 2009-07-17 16:43:42 -0600 (Fri, 17 Jul 2009)
New Revision: 8741

Modified:
   gnunet/src/datastore/perf_plugin_datastore.c
   gnunet/src/datastore/plugin_datastore_sqlite.c
Log:
debugstuff

Modified: gnunet/src/datastore/perf_plugin_datastore.c
===================================================================
--- gnunet/src/datastore/perf_plugin_datastore.c        2009-07-17 21:11:03 UTC 
(rev 8740)
+++ gnunet/src/datastore/perf_plugin_datastore.c        2009-07-17 22:43:42 UTC 
(rev 8741)
@@ -28,7 +28,7 @@
 #include "gnunet_protocols.h"
 #include "plugin_datastore.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 /**
  * Target datastore size (in bytes).  Realistic sizes are
@@ -36,9 +36,10 @@
  * those take too long to run them in the usual "make check"
  * sequence.  Hence the value used for shipping is tiny.
  */
-#define MAX_SIZE 1024LL * 1024 * 128
+#define MAX_SIZE 1024LL * 1024 / 4
+// * 128
 
-#define ITERATIONS 10
+#define ITERATIONS 2
 
 /**
  * Number of put operations equivalent to 1/10th of MAX_SIZE
@@ -88,6 +89,7 @@
   static GNUNET_HashCode key;
   static int ic;
   char *msg;
+  unsigned int prio;
 
   /* most content is 32k */
   size = 32 * 1024;
@@ -104,12 +106,13 @@
     memset (value, i - 255, size / 2);
   value[0] = k;
   msg = NULL;
+  prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100);
   if (GNUNET_OK != api->put (api->cls,
                             &key, 
                             size,
                             value,
                             i,
-                            GNUNET_CRYPTO_random_u32 
(GNUNET_CRYPTO_QUALITY_WEAK, 100),
+                            prio,
                             i,
                             GNUNET_TIME_relative_to_absolute 
                             (GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS,
@@ -172,6 +175,11 @@
                                  &test, crc);
       return GNUNET_OK;
     }
+#if VERBOSE
+  fprintf (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
+          type, priority, size,
+          (unsigned long long) expiration.value);
+#endif
   crc->cnt++;
   crc->api->next_request (next_cls,
                          GNUNET_NO);

Modified: gnunet/src/datastore/plugin_datastore_sqlite.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_sqlite.c      2009-07-17 21:11:03 UTC 
(rev 8740)
+++ gnunet/src/datastore/plugin_datastore_sqlite.c      2009-07-17 22:43:42 UTC 
(rev 8741)
@@ -29,7 +29,7 @@
 #include "plugin_datastore.h"
 #include <sqlite3.h>
 
-#define DEBUG_SQLITE GNUNET_NO
+#define DEBUG_SQLITE GNUNET_YES
 
 /**
  * After how many payload-changing operations
@@ -899,6 +899,10 @@
                GNUNET_ERROR_TYPE_ERROR |
                GNUNET_ERROR_TYPE_BULK,
                "sqlite3_reset");
+#if DEBUG_SQLITE
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "No result found using either iterator\n");
+#endif
   return GNUNET_NO;
 }
 
@@ -932,6 +936,13 @@
   sqlite3_stmt *stmt_1;
   sqlite3_stmt *stmt_2;
 
+#if DEBUG_SQLITE
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "At %llu, using queries `%s' and `%s'\n",
+             (unsigned long long) GNUNET_TIME_absolute_get ().value,
+             stmt_str_1,
+             stmt_str_2);
+#endif
   if (sq_prepare (plugin->dbh, stmt_str_1, &stmt_1) != SQLITE_OK)
     {
       LOG_SQLITE (plugin, NULL,
@@ -1029,9 +1040,9 @@
 
   now = GNUNET_TIME_absolute_get ();
   GNUNET_asprintf (&q1, SELECT_IT_NON_ANONYMOUS_1,
-                  now.value);
+                  (unsigned long long) now.value);
   GNUNET_asprintf (&q2, SELECT_IT_NON_ANONYMOUS_2,
-                  now.value);
+                  (unsigned long long) now.value);
   basic_iter (cls,
              type, 
              GNUNET_NO, GNUNET_YES, 
@@ -1067,9 +1078,9 @@
 
   now = GNUNET_TIME_absolute_get ();
   GNUNET_asprintf (&q1, SELECT_IT_EXPIRATION_TIME_1,
-                  now.value);
+                  (unsigned long long) 0*now.value);
   GNUNET_asprintf (&q2, SELECT_IT_EXPIRATION_TIME_2,
-                  now.value);
+                  (unsigned long long) 0*now.value);
   basic_iter (cls,
              type, 
              GNUNET_YES, GNUNET_NO, 
@@ -1102,7 +1113,7 @@
 
   now = GNUNET_TIME_absolute_get ();
   GNUNET_asprintf (&q, SELECT_IT_MIGRATION_ORDER_2,
-                  now.value);
+                  (unsigned long long) now.value);
   basic_iter (cls,
              type, 
              GNUNET_NO, GNUNET_NO, 
@@ -1132,10 +1143,6 @@
   plugin = nc->plugin;
   if (SQLITE_ROW == (ret = sqlite3_step (nc->stmt)))
     {      
-#if DEBUG_SQLITE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "Result found\n");
-#endif
       return GNUNET_OK;
     }
   if (ret != SQLITE_DONE)





reply via email to

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