gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r11622 - gnunet/src/datastore
Date: Sun, 6 Jun 2010 23:50:01 +0200

Author: grothoff
Date: 2010-06-06 23:50:01 +0200 (Sun, 06 Jun 2010)
New Revision: 11622

Modified:
   gnunet/src/datastore/gnunet-service-datastore.c
Log:
more data

Modified: gnunet/src/datastore/gnunet-service-datastore.c
===================================================================
--- gnunet/src/datastore/gnunet-service-datastore.c     2010-06-06 11:11:04 UTC 
(rev 11621)
+++ gnunet/src/datastore/gnunet-service-datastore.c     2010-06-06 21:50:01 UTC 
(rev 11622)
@@ -399,7 +399,7 @@
 #if DEBUG_DATASTORE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Deleting %llu bytes of low-priority content `%s' of type %u 
(still trying to free another %llu bytes)\n",
-             size + GNUNET_DATASTORE_ENTRY_OVERHEAD,
+             (unsigned long long) (size + GNUNET_DATASTORE_ENTRY_OVERHEAD),
              GNUNET_h2s (key),
              type,
              *need);
@@ -765,6 +765,10 @@
       return;      
     }
   reserved += req;
+  GNUNET_STATISTICS_set (stats,
+                        gettext_noop ("# reserved"),
+                        reserved,
+                        GNUNET_NO);
   e = GNUNET_malloc (sizeof(struct ReservationList));
   e->next = reservations;
   reservations = e;
@@ -816,6 +820,10 @@
          rem = pos->amount + ((unsigned long long) 
GNUNET_DATASTORE_ENTRY_OVERHEAD) * pos->entries;
          GNUNET_assert (reserved >= rem);
          reserved -= rem;
+         GNUNET_STATISTICS_set (stats,
+                        gettext_noop ("# reserved"),
+                                reserved,
+                                GNUNET_NO);
 #if DEBUG_DATASTORE
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                      "Returning %llu remaining reserved bytes to storage 
pool\n",
@@ -910,6 +918,10 @@
          pos->entries--;
          pos->amount -= size;
          reserved -= (size + GNUNET_DATASTORE_ENTRY_OVERHEAD);
+         GNUNET_STATISTICS_set (stats,
+                                gettext_noop ("# reserved"),
+                                reserved,
+                                GNUNET_NO);
        }
     }
   msg = NULL;
@@ -943,7 +955,14 @@
                   msg);
   GNUNET_free_non_null (msg);
   if (quota - reserved - cache_size < plugin->api->get_size (plugin->api->cls))
-    manage_space (size + GNUNET_DATASTORE_ENTRY_OVERHEAD);
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 _("Need %llu bytes more space (%llu allowed, using %llu)\n"),
+                 (unsigned long long) size + GNUNET_DATASTORE_ENTRY_OVERHEAD,
+                 (unsigned long long) (quota - reserved - cache_size),
+                 (unsigned long long) plugin->api->get_size 
(plugin->api->cls));
+      manage_space (size + GNUNET_DATASTORE_ENTRY_OVERHEAD);
+    }
 }
 
 
@@ -1403,6 +1422,10 @@
        }
       pos = next;
     }
+  GNUNET_STATISTICS_set (stats,
+                        gettext_noop ("# reserved"),
+                        reserved,
+                        GNUNET_NO);
 }
 
 
@@ -1436,7 +1459,15 @@
       return;
     }
   stats = GNUNET_STATISTICS_create (sched, "datastore", cfg);
+  GNUNET_STATISTICS_set (stats,
+                        gettext_noop ("# quota"),
+                        quota,
+                        GNUNET_NO);
   cache_size = quota / 8; /* Or should we make this an option? */
+  GNUNET_STATISTICS_set (stats,
+                        gettext_noop ("# cache size"),
+                        cache_size,
+                        GNUNET_NO);
   bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */
   fn = NULL;
   if ( (GNUNET_OK !=




reply via email to

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