[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14396 - in gnunet/src: include transport util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14396 - in gnunet/src: include transport util |
Date: |
Sun, 13 Feb 2011 10:42:03 +0100 |
Author: grothoff
Date: 2011-02-13 10:42:03 +0100 (Sun, 13 Feb 2011)
New Revision: 14396
Modified:
gnunet/src/include/gnunet_container_lib.h
gnunet/src/transport/test_transport_api_reliability.c
gnunet/src/transport/test_transport_api_unreliability.c
gnunet/src/util/container_bloomfilter.c
Log:
correct unit placement for GAUGER calls
Modified: gnunet/src/include/gnunet_container_lib.h
===================================================================
--- gnunet/src/include/gnunet_container_lib.h 2011-02-12 03:38:31 UTC (rev
14395)
+++ gnunet/src/include/gnunet_container_lib.h 2011-02-13 09:42:03 UTC (rev
14396)
@@ -65,6 +65,7 @@
typedef int (*GNUNET_HashCodeIterator) (void *cls,
GNUNET_HashCode * next);
+
/**
* Load a bloom-filter from a file.
*
@@ -85,6 +86,7 @@
int
k);
+
/**
* Create a bloom filter from raw bits.
*
@@ -108,6 +110,7 @@
int
k);
+
/**
* Copy the raw data of this bloomfilter into
* the given data array.
@@ -121,6 +124,7 @@
*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_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 @@
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,12 +152,24 @@
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
+ * free the space on the drive)
+ * @param bf the filter
+ */
void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter
*bf);
@@ -942,8 +960,10 @@
*
*/
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
* towards elements closer to the root of the tree (since
Modified: gnunet/src/transport/test_transport_api_reliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_reliability.c 2011-02-12
03:38:31 UTC (rev 14395)
+++ gnunet/src/transport/test_transport_api_reliability.c 2011-02-13
09:42:03 UTC (rev 14396)
@@ -133,7 +133,7 @@
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;
Modified: gnunet/src/transport/test_transport_api_unreliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_unreliability.c 2011-02-12
03:38:31 UTC (rev 14395)
+++ gnunet/src/transport/test_transport_api_unreliability.c 2011-02-13
09:42:03 UTC (rev 14396)
@@ -186,7 +186,7 @@
"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 @@
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);
Modified: gnunet/src/util/container_bloomfilter.c
===================================================================
--- gnunet/src/util/container_bloomfilter.c 2011-02-12 03:38:31 UTC (rev
14395)
+++ gnunet/src/util/container_bloomfilter.c 2011-02-13 09:42:03 UTC (rev
14396)
@@ -93,6 +93,21 @@
/**
+ * 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).
*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14396 - in gnunet/src: include transport util,
gnunet <=