gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r7737 - GNUnet/src/applications/sqstore_sqlite


From: gnunet
Subject: [GNUnet-SVN] r7737 - GNUnet/src/applications/sqstore_sqlite
Date: Mon, 6 Oct 2008 17:20:47 -0600 (MDT)

Author: durner
Date: 2008-10-06 17:20:47 -0600 (Mon, 06 Oct 2008)
New Revision: 7737

Modified:
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
Log:
report memory utilization

Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2008-10-05 06:32:29 UTC 
(rev 7736)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2008-10-06 23:20:47 UTC 
(rev 7737)
@@ -124,6 +124,7 @@
 static GNUNET_CoreAPIForPlugins *coreAPI;
 
 static unsigned int stat_size;
+static unsigned int stat_mem;
 
 static struct GNUNET_GE_Context *ectx;
 
@@ -367,7 +368,12 @@
   GNUNET_mutex_lock (lock);
   ret = payload;
   if (stats)
-    stats->set (stat_size, ret);
+    {
+      stats->set (stat_size, ret);
+#if DEBUG_SQLITE
+      stats->set (stat_mem, sqlite3_memory_used ());
+#endif
+    }
   GNUNET_mutex_unlock (lock);
   return (unsigned long long) (ret * 1.13);
   /* benchmarking shows 13% overhead */
@@ -1335,7 +1341,7 @@
         {
           sqlite3_reset (stmt);
           GNUNET_mutex_unlock (lock);
-         GNUNET_GE_BREAK(NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_NO;
         }
       LOG_SQLITE (dbh,
@@ -1454,7 +1460,10 @@
   coreAPI = capi;
   stats = coreAPI->service_request ("stats");
   if (stats)
-    stat_size = stats->create (gettext_noop ("# bytes in datastore"));
+    {
+      stat_size = stats->create (gettext_noop ("# bytes in datastore"));
+      stat_mem = stats->create (gettext_noop ("# bytes allocated by SQLite"));
+    }
 
   api.getSize = &getSize;
   api.put = &put;





reply via email to

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