diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-17 22:43:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-17 22:43:42 +0000 |
commit | 440ad169d0f6dc03d6cabd484698fe8c0f62d1b8 (patch) | |
tree | 19d9544794afa3d8690e61f8733287f5c5356497 /src/datastore/perf_plugin_datastore.c | |
parent | 13b0e8bc3bd62ef8a9b0c09086e95bb7cfa8a3ab (diff) | |
download | gnunet-440ad169d0f6dc03d6cabd484698fe8c0f62d1b8.tar.gz gnunet-440ad169d0f6dc03d6cabd484698fe8c0f62d1b8.zip |
debugstuff
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 85659f06a..0eed035d1 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "gnunet_protocols.h" | 28 | #include "gnunet_protocols.h" |
29 | #include "plugin_datastore.h" | 29 | #include "plugin_datastore.h" |
30 | 30 | ||
31 | #define VERBOSE GNUNET_NO | 31 | #define VERBOSE GNUNET_YES |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * Target datastore size (in bytes). Realistic sizes are | 34 | * Target datastore size (in bytes). Realistic sizes are |
@@ -36,9 +36,10 @@ | |||
36 | * those take too long to run them in the usual "make check" | 36 | * those take too long to run them in the usual "make check" |
37 | * sequence. Hence the value used for shipping is tiny. | 37 | * sequence. Hence the value used for shipping is tiny. |
38 | */ | 38 | */ |
39 | #define MAX_SIZE 1024LL * 1024 * 128 | 39 | #define MAX_SIZE 1024LL * 1024 / 4 |
40 | // * 128 | ||
40 | 41 | ||
41 | #define ITERATIONS 10 | 42 | #define ITERATIONS 2 |
42 | 43 | ||
43 | /** | 44 | /** |
44 | * Number of put operations equivalent to 1/10th of MAX_SIZE | 45 | * Number of put operations equivalent to 1/10th of MAX_SIZE |
@@ -88,6 +89,7 @@ putValue (struct GNUNET_DATASTORE_PluginFunctions * api, int i, int k) | |||
88 | static GNUNET_HashCode key; | 89 | static GNUNET_HashCode key; |
89 | static int ic; | 90 | static int ic; |
90 | char *msg; | 91 | char *msg; |
92 | unsigned int prio; | ||
91 | 93 | ||
92 | /* most content is 32k */ | 94 | /* most content is 32k */ |
93 | size = 32 * 1024; | 95 | size = 32 * 1024; |
@@ -104,12 +106,13 @@ putValue (struct GNUNET_DATASTORE_PluginFunctions * api, int i, int k) | |||
104 | memset (value, i - 255, size / 2); | 106 | memset (value, i - 255, size / 2); |
105 | value[0] = k; | 107 | value[0] = k; |
106 | msg = NULL; | 108 | msg = NULL; |
109 | prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100); | ||
107 | if (GNUNET_OK != api->put (api->cls, | 110 | if (GNUNET_OK != api->put (api->cls, |
108 | &key, | 111 | &key, |
109 | size, | 112 | size, |
110 | value, | 113 | value, |
111 | i, | 114 | i, |
112 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100), | 115 | prio, |
113 | i, | 116 | i, |
114 | GNUNET_TIME_relative_to_absolute | 117 | GNUNET_TIME_relative_to_absolute |
115 | (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | 118 | (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, |
@@ -172,6 +175,11 @@ iterateDummy (void *cls, | |||
172 | &test, crc); | 175 | &test, crc); |
173 | return GNUNET_OK; | 176 | return GNUNET_OK; |
174 | } | 177 | } |
178 | #if VERBOSE | ||
179 | fprintf (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n", | ||
180 | type, priority, size, | ||
181 | (unsigned long long) expiration.value); | ||
182 | #endif | ||
175 | crc->cnt++; | 183 | crc->cnt++; |
176 | crc->api->next_request (next_cls, | 184 | crc->api->next_request (next_cls, |
177 | GNUNET_NO); | 185 | GNUNET_NO); |