correct unit placement for GAUGER calls
authorChristian Grothoff <christian@grothoff.org>
Sun, 13 Feb 2011 09:42:03 +0000 (09:42 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 13 Feb 2011 09:42:03 +0000 (09:42 +0000)
src/include/gnunet_container_lib.h
src/transport/test_transport_api_reliability.c
src/transport/test_transport_api_unreliability.c
src/util/container_bloomfilter.c

index c5f46b41904302eaaab543ebc13bcaf84d873f92..908657d6bdd62bafdcdd9df6fef3c90587506eb7 100644 (file)
@@ -65,6 +65,7 @@ struct GNUNET_CONTAINER_BloomFilter;
 typedef int (*GNUNET_HashCodeIterator) (void *cls,
                                        GNUNET_HashCode * next);
 
+
 /**
  * Load a bloom-filter from a file.
  *
@@ -85,6 +86,7 @@ GNUNET_CONTAINER_bloomfilter_load (const
                                   int
                                   k);
 
+
 /**
  * Create a bloom filter from raw bits.
  *
@@ -108,6 +110,7 @@ GNUNET_CONTAINER_bloomfilter_init (const
                                   int
                                   k);
 
+
 /**
  * Copy the raw data of this bloomfilter into
  * the given data array.
@@ -121,6 +124,7 @@ int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct
                                                *bf, char *data,
                                                size_t size);
 
+
 /**
  * Test if an element is in the filter.
  * @param e the element
@@ -130,6 +134,7 @@ int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct
 int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter
                                        *bf, const GNUNET_HashCode * e);
 
+
 /**
  * Add an element to the filter
  * @param bf the filter
@@ -138,6 +143,7 @@ int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter
 void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter
                                        *bf, const GNUNET_HashCode * e);
 
+
 /**
  * Remove an element from the filter.
  * @param bf the filter
@@ -146,6 +152,18 @@ void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter
 void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter
                                           *bf, const GNUNET_HashCode * e);
 
+
+/**
+ * Free the space associcated with a filter
+ * in memory, flush to drive if needed (do not
+ * free the space on the drive)
+ * @param bf the filter
+ */
+struct GNUNET_CONTAINER_BloomFilter *
+GNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter *bf);
+
+
+
 /**
  * Free the space associcated with a filter
  * in memory, flush to drive if needed (do not
@@ -942,7 +960,9 @@ GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap,
  *
  */
 void *
-GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, uint32_t max);
+GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, 
+                                 uint32_t max);
+
 
 /**
  * Perform a random walk of the tree.  The walk is biased
index 306e88ed84aaba9195bf282e6b0db7437268ed07..472c30d0d46935077544ff4fc1f2985a819294c9 100644 (file)
@@ -133,7 +133,7 @@ end ()
   fprintf (stderr,
           "\nThroughput was %llu kb/s\n",
           total_bytes * 1000 / 1024 / delta);
-  GNUNET_asprintf(&value_name, "reliable_kbs_%s", test_name);
+  GNUNET_asprintf(&value_name, "reliable-%s_kb/s", test_name);
   GAUGER (value_name, (int)(total_bytes * 1000 / 1024 /delta));
   GNUNET_free(value_name);
   ok = 0;
index 2ca08c5b83521895fa544b71c5fb5645dc9f3491..26d4cb035cb1b6217a9e508440420c5c9818e016 100644 (file)
@@ -186,7 +186,7 @@ end ()
              "Transports disconnected, returning success!\n");
 #endif
   delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
-  GNUNET_asprintf(&value_name, "unreliable_kbs_%s", test_name);
+  GNUNET_asprintf(&value_name, "unreliable-%s_kb/s", test_name);
   GAUGER (value_name, (int)(total_bytes * 1000 / 1024 /delta));
   GNUNET_free(value_name);
   fprintf (stderr,
@@ -227,10 +227,10 @@ end_unreliably ()
   fprintf (stderr,
            "\nThroughput was %llu kb/s\n",
            total_bytes * 1000 / 1024 / delta);
-  GNUNET_asprintf(&value_name, "unreliable_kbs_%s", test_name);
+  GNUNET_asprintf(&value_name, "unreliable-%s_kb/s", test_name);
   GAUGER (value_name, (int)(total_bytes * 1000 / 1024 /delta));
   GNUNET_free(value_name);
-  GNUNET_asprintf(&value_name, "unreliable_failed_%s", test_name);
+  GNUNET_asprintf(&value_name, "unreliable-%s_failed messages", test_name);
   GAUGER (value_name, (int)num_failed);
   GNUNET_free(value_name);
   GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Had %d failed messages!\n", num_failed);
index d9cadb9451c9c16e93212991efdf677119b25fd4..ea9c4e1543535d089e5ce141e97fdce4f27e5d9e 100644 (file)
@@ -92,6 +92,21 @@ GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter
 }
 
 
+/**
+ * Copy an existing memory.  Any association with a file
+ * on-disk will be lost in the process.
+ * @param bf the filter to copy
+ * @retun copy of the bf
+ */
+struct GNUNET_CONTAINER_BloomFilter *
+GNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter *bf)
+{
+  return GNUNET_CONTAINER_bloomfilter_init (bf->bitArray,
+                                           bf->bitArraySize,
+                                           bf->addressesPerElement);                                       
+}
+
+
 /**
  * Sets a bit active in the bitArray. Increment bit-specific
  * usage counter on disk only if below 4bit max (==15).