aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-04-15 13:27:55 +0000
committerChristian Grothoff <christian@grothoff.org>2011-04-15 13:27:55 +0000
commit83250d05b7a67c36350d7c1a8d6a7aacbfdcd316 (patch)
tree05536fcc0dabf6e567cba8f16c94704f06f6b331 /src/datastore
parent774b725aa1aadc64f39fdae76530063b51f3ebc5 (diff)
downloadgnunet-83250d05b7a67c36350d7c1a8d6a7aacbfdcd316.tar.gz
gnunet-83250d05b7a67c36350d7c1a8d6a7aacbfdcd316.zip
fixes
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/perf_plugin_datastore.c17
-rw-r--r--src/datastore/plugin_datastore_postgres.c3
2 files changed, 15 insertions, 5 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c
index 940dd9b97..80926bb9f 100644
--- a/src/datastore/perf_plugin_datastore.c
+++ b/src/datastore/perf_plugin_datastore.c
@@ -39,7 +39,7 @@
39 */ 39 */
40#define MAX_SIZE 1024LL * 1024 * 128 40#define MAX_SIZE 1024LL * 1024 * 128
41 41
42#define ITERATIONS 10 42#define ITERATIONS 2
43 43
44/** 44/**
45 * Number of put operations equivalent to 1/10th of MAX_SIZE 45 * Number of put operations equivalent to 1/10th of MAX_SIZE
@@ -80,6 +80,7 @@ struct CpsRunContext
80 struct GNUNET_DATASTORE_PluginFunctions * api; 80 struct GNUNET_DATASTORE_PluginFunctions * api;
81 enum RunPhase phase; 81 enum RunPhase phase;
82 unsigned int cnt; 82 unsigned int cnt;
83 unsigned int iter;
83}; 84};
84 85
85 86
@@ -199,9 +200,12 @@ iterate_zeros (void *cls,
199 GNUNET_break (0); 200 GNUNET_break (0);
200 crc->phase = RP_ERROR; 201 crc->phase = RP_ERROR;
201 } 202 }
202 crc->phase++; 203 else
203 crc->cnt = 0; 204 {
204 crc->start = GNUNET_TIME_absolute_get (); 205 crc->phase++;
206 crc->cnt = 0;
207 crc->start = GNUNET_TIME_absolute_get ();
208 }
205 GNUNET_SCHEDULER_add_now (&test, crc); 209 GNUNET_SCHEDULER_add_now (&test, crc);
206 return GNUNET_OK; 210 return GNUNET_OK;
207 } 211 }
@@ -263,7 +267,10 @@ expiration_get (void *cls,
263 (unsigned int) PUT_10); 267 (unsigned int) PUT_10);
264 GAUGER (category, buf, crc->end.abs_value - crc->start.abs_value, "ms"); 268 GAUGER (category, buf, crc->end.abs_value - crc->start.abs_value, "ms");
265 memset (hits, 0, sizeof (hits)); 269 memset (hits, 0, sizeof (hits));
266 crc->phase++; 270 if (++crc->iter == ITERATIONS)
271 crc->phase++;
272 else
273 crc->phase = RP_PUT;
267 crc->cnt = 0; 274 crc->cnt = 0;
268 crc->start = GNUNET_TIME_absolute_get (); 275 crc->start = GNUNET_TIME_absolute_get ();
269 } 276 }
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 2cecfa9a1..aea87fdf4 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -998,6 +998,7 @@ postgres_plugin_iter_zero_anonymity (void *cls,
998 struct NextRequestClosure *nrc; 998 struct NextRequestClosure *nrc;
999 999
1000 nrc = GNUNET_malloc (sizeof (struct NextRequestClosure)); 1000 nrc = GNUNET_malloc (sizeof (struct NextRequestClosure));
1001 nrc->total = UINT32_MAX;
1001 nrc->btype = htonl ((uint32_t) type); 1002 nrc->btype = htonl ((uint32_t) type);
1002 nrc->plugin = plugin; 1003 nrc->plugin = plugin;
1003 nrc->iter = iter; 1004 nrc->iter = iter;
@@ -1125,6 +1126,7 @@ postgres_plugin_replication_get (void *cls,
1125 rc.iter_cls = iter_cls; 1126 rc.iter_cls = iter_cls;
1126 nrc = GNUNET_malloc (sizeof (struct NextRequestClosure)); 1127 nrc = GNUNET_malloc (sizeof (struct NextRequestClosure));
1127 nrc->one_shot = GNUNET_YES; 1128 nrc->one_shot = GNUNET_YES;
1129 nrc->total = 1;
1128 nrc->plugin = plugin; 1130 nrc->plugin = plugin;
1129 nrc->iter = &repl_iter; 1131 nrc->iter = &repl_iter;
1130 nrc->iter_cls = &rc; 1132 nrc->iter_cls = &rc;
@@ -1153,6 +1155,7 @@ postgres_plugin_expiration_get (void *cls,
1153 btime = GNUNET_htonll (GNUNET_TIME_absolute_get ().abs_value); 1155 btime = GNUNET_htonll (GNUNET_TIME_absolute_get ().abs_value);
1154 nrc = GNUNET_malloc (sizeof (struct NextRequestClosure)); 1156 nrc = GNUNET_malloc (sizeof (struct NextRequestClosure));
1155 nrc->one_shot = GNUNET_YES; 1157 nrc->one_shot = GNUNET_YES;
1158 nrc->total = 1;
1156 nrc->plugin = plugin; 1159 nrc->plugin = plugin;
1157 nrc->iter = iter; 1160 nrc->iter = iter;
1158 nrc->iter_cls = iter_cls; 1161 nrc->iter_cls = iter_cls;