aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/perf_plugin_datastore.c
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/perf_plugin_datastore.c
parent774b725aa1aadc64f39fdae76530063b51f3ebc5 (diff)
downloadgnunet-83250d05b7a67c36350d7c1a8d6a7aacbfdcd316.tar.gz
gnunet-83250d05b7a67c36350d7c1a8d6a7aacbfdcd316.zip
fixes
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r--src/datastore/perf_plugin_datastore.c17
1 files changed, 12 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 }