diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-16 22:30:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-16 22:30:44 +0000 |
commit | c058ee40c3fe37e722329cdea0450a8a33aab92b (patch) | |
tree | eb43e3dff5cf11348a8af8c01c32ee12faa5e772 | |
parent | 700336146abfc054ce2a380b2511a9bbe77f4ec1 (diff) | |
download | gnunet-c058ee40c3fe37e722329cdea0450a8a33aab92b.tar.gz gnunet-c058ee40c3fe37e722329cdea0450a8a33aab92b.zip |
fixing compilation problems
-rw-r--r-- | src/datastore/perf_datastore_api.c | 6 | ||||
-rw-r--r-- | src/datastore/perf_datastore_api_iterators.c | 13 | ||||
-rw-r--r-- | src/datastore/test_datastore_api.c | 6 |
3 files changed, 19 insertions, 6 deletions
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index f10f6d0f5..5813634d9 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c | |||
@@ -41,6 +41,11 @@ | |||
41 | static struct GNUNET_DATASTORE_Handle *datastore; | 41 | static struct GNUNET_DATASTORE_Handle *datastore; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * How long until we give up on transmitting the message? | ||
45 | */ | ||
46 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) | ||
47 | |||
48 | /** | ||
44 | * Target datastore size (in bytes). | 49 | * Target datastore size (in bytes). |
45 | * <p> | 50 | * <p> |
46 | * Example impact of total size on the reported number | 51 | * Example impact of total size on the reported number |
@@ -137,6 +142,7 @@ putValue (int i, int k) | |||
137 | GNUNET_TIME_relative_to_absolute | 142 | GNUNET_TIME_relative_to_absolute |
138 | (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 143 | (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
139 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), | 144 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), |
145 | TIMEOUT, | ||
140 | NULL, NULL); | 146 | NULL, NULL); |
141 | ic++; | 147 | ic++; |
142 | #if REPORT_ID | 148 | #if REPORT_ID |
diff --git a/src/datastore/perf_datastore_api_iterators.c b/src/datastore/perf_datastore_api_iterators.c index 635fa1f28..f03b2ebf1 100644 --- a/src/datastore/perf_datastore_api_iterators.c +++ b/src/datastore/perf_datastore_api_iterators.c | |||
@@ -141,32 +141,33 @@ test (struct GNUNET_DATASTORE_PluginFunctions * api) | |||
141 | break; | 141 | break; |
142 | } | 142 | } |
143 | end = GNUNET_TIME_absolute_get (); | 143 | end = GNUNET_TIME_absolute_get (); |
144 | printf ("%3u insertion took %20llums\n", i, end.value - start.value); | 144 | printf ("%3u insertion took %20llums\n", i, |
145 | (unsigned long long) (end.value - start.value)); | ||
145 | start = end; | 146 | start = end; |
146 | api->iter_low_priority (api->cls, 0, &iterateDummy, api); | 147 | api->iter_low_priority (api->cls, 0, &iterateDummy, api); |
147 | end = GNUNET_TIME_absolute_get (); | 148 | end = GNUNET_TIME_absolute_get (); |
148 | printf ("%3u low priority iteration took %20llums\n", i, | 149 | printf ("%3u low priority iteration took %20llums\n", i, |
149 | end.value - start.value); | 150 | (unsigned long long) (end.value - start.value)); |
150 | start = end; | 151 | start = end; |
151 | api->iter_ascending_expiration (api->cls, 0, &iterateDummy, api); | 152 | api->iter_ascending_expiration (api->cls, 0, &iterateDummy, api); |
152 | end = GNUNET_TIME_absolute_get (); | 153 | end = GNUNET_TIME_absolute_get (); |
153 | printf ("%3u expiration t iteration took %20llums\n", i, | 154 | printf ("%3u expiration t iteration took %20llums\n", i, |
154 | end.value - start.value); | 155 | (unsigned long long) (end.value - start.value)); |
155 | start = end; | 156 | start = end; |
156 | api->iter_zero_anonymity (api->cls, 0, &iterateDummy, api); | 157 | api->iter_zero_anonymity (api->cls, 0, &iterateDummy, api); |
157 | end = GNUNET_TIME_absolute_get (); | 158 | end = GNUNET_TIME_absolute_get (); |
158 | printf ("%3u non anonymou iteration took %20llums\n", i, | 159 | printf ("%3u non anonymou iteration took %20llums\n", i, |
159 | end.value - start.value); | 160 | (unsigned long long) (end.value - start.value)); |
160 | start = end; | 161 | start = end; |
161 | api->iter_migration_order (api->cls, 0, &iterateDummy, api); | 162 | api->iter_migration_order (api->cls, 0, &iterateDummy, api); |
162 | end = GNUNET_TIME_absolute_get (); | 163 | end = GNUNET_TIME_absolute_get (); |
163 | printf ("%3u migration or iteration took %20llums\n", i, | 164 | printf ("%3u migration or iteration took %20llums\n", i, |
164 | end.value - start.value); | 165 | (unsigned long long) (end.value - start.value)); |
165 | start = end; | 166 | start = end; |
166 | api->iter_all_now (api->cls, 0, &iterateDummy, api); | 167 | api->iter_all_now (api->cls, 0, &iterateDummy, api); |
167 | end = GNUNET_TIME_absolute_get (); | 168 | end = GNUNET_TIME_absolute_get (); |
168 | printf ("%3u all now iteration took %20llums\n", i, | 169 | printf ("%3u all now iteration took %20llums\n", i, |
169 | end.value - start.value); | 170 | (unsigned long long) (end.value - start.value)); |
170 | } | 171 | } |
171 | api->drop (api->cls); | 172 | api->drop (api->cls); |
172 | return GNUNET_OK; | 173 | return GNUNET_OK; |
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index b4da05fda..28fc12ef6 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c | |||
@@ -33,6 +33,11 @@ | |||
33 | #include "gnunet_protocols.h" | 33 | #include "gnunet_protocols.h" |
34 | #include "gnunet_datastore_service.h" | 34 | #include "gnunet_datastore_service.h" |
35 | 35 | ||
36 | /** | ||
37 | * How long until we give up on transmitting the message? | ||
38 | */ | ||
39 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) | ||
40 | |||
36 | static struct GNUNET_DATASTORE_Handle *datastore; | 41 | static struct GNUNET_DATASTORE_Handle *datastore; |
37 | 42 | ||
38 | static struct GNUNET_TIME_Absolute now; | 43 | static struct GNUNET_TIME_Absolute now; |
@@ -253,6 +258,7 @@ run_continuation (void *cls, | |||
253 | get_priority (crc->i), | 258 | get_priority (crc->i), |
254 | get_anonymity (crc->i), | 259 | get_anonymity (crc->i), |
255 | get_expiration (crc->i), | 260 | get_expiration (crc->i), |
261 | TIMEOUT, | ||
256 | &check_success, | 262 | &check_success, |
257 | crc); | 263 | crc); |
258 | crc->i++; | 264 | crc->i++; |