From 83250d05b7a67c36350d7c1a8d6a7aacbfdcd316 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 15 Apr 2011 13:27:55 +0000 Subject: [PATCH] fixes --- src/datastore/perf_plugin_datastore.c | 17 ++++++++++++----- src/datastore/plugin_datastore_postgres.c | 3 +++ 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 @@ */ #define MAX_SIZE 1024LL * 1024 * 128 -#define ITERATIONS 10 +#define ITERATIONS 2 /** * Number of put operations equivalent to 1/10th of MAX_SIZE @@ -80,6 +80,7 @@ struct CpsRunContext struct GNUNET_DATASTORE_PluginFunctions * api; enum RunPhase phase; unsigned int cnt; + unsigned int iter; }; @@ -199,9 +200,12 @@ iterate_zeros (void *cls, GNUNET_break (0); crc->phase = RP_ERROR; } - crc->phase++; - crc->cnt = 0; - crc->start = GNUNET_TIME_absolute_get (); + else + { + crc->phase++; + crc->cnt = 0; + crc->start = GNUNET_TIME_absolute_get (); + } GNUNET_SCHEDULER_add_now (&test, crc); return GNUNET_OK; } @@ -263,7 +267,10 @@ expiration_get (void *cls, (unsigned int) PUT_10); GAUGER (category, buf, crc->end.abs_value - crc->start.abs_value, "ms"); memset (hits, 0, sizeof (hits)); - crc->phase++; + if (++crc->iter == ITERATIONS) + crc->phase++; + else + crc->phase = RP_PUT; crc->cnt = 0; crc->start = GNUNET_TIME_absolute_get (); } 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, struct NextRequestClosure *nrc; nrc = GNUNET_malloc (sizeof (struct NextRequestClosure)); + nrc->total = UINT32_MAX; nrc->btype = htonl ((uint32_t) type); nrc->plugin = plugin; nrc->iter = iter; @@ -1125,6 +1126,7 @@ postgres_plugin_replication_get (void *cls, rc.iter_cls = iter_cls; nrc = GNUNET_malloc (sizeof (struct NextRequestClosure)); nrc->one_shot = GNUNET_YES; + nrc->total = 1; nrc->plugin = plugin; nrc->iter = &repl_iter; nrc->iter_cls = &rc; @@ -1153,6 +1155,7 @@ postgres_plugin_expiration_get (void *cls, btime = GNUNET_htonll (GNUNET_TIME_absolute_get ().abs_value); nrc = GNUNET_malloc (sizeof (struct NextRequestClosure)); nrc->one_shot = GNUNET_YES; + nrc->total = 1; nrc->plugin = plugin; nrc->iter = iter; nrc->iter_cls = iter_cls; -- 2.25.1