diff options
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 13 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_sqlite.c | 6 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 7f6b7fee0..54f1eb90c 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -67,7 +67,7 @@ enum RunPhase | |||
67 | 67 | ||
68 | struct CpsRunContext | 68 | struct CpsRunContext |
69 | { | 69 | { |
70 | int i; | 70 | unsigned int i; |
71 | struct GNUNET_TIME_Absolute start; | 71 | struct GNUNET_TIME_Absolute start; |
72 | struct GNUNET_TIME_Absolute end; | 72 | struct GNUNET_TIME_Absolute end; |
73 | struct GNUNET_SCHEDULER_Handle *sched; | 73 | struct GNUNET_SCHEDULER_Handle *sched; |
@@ -126,6 +126,10 @@ putValue (struct GNUNET_DATASTORE_PluginFunctions * api, int i, int k) | |||
126 | stored_entries++; | 126 | stored_entries++; |
127 | } | 127 | } |
128 | 128 | ||
129 | static void | ||
130 | test (void *cls, | ||
131 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
132 | |||
129 | 133 | ||
130 | static int | 134 | static int |
131 | iterateDummy (void *cls, | 135 | iterateDummy (void *cls, |
@@ -146,6 +150,7 @@ iterateDummy (void *cls, | |||
146 | { | 150 | { |
147 | crc->end = GNUNET_TIME_absolute_get(); | 151 | crc->end = GNUNET_TIME_absolute_get(); |
148 | printf (crc->msg, | 152 | printf (crc->msg, |
153 | crc->i, | ||
149 | (unsigned long long) (crc->end.value - crc->start.value)); | 154 | (unsigned long long) (crc->end.value - crc->start.value)); |
150 | if (crc->phase != RP_AN_GET) | 155 | if (crc->phase != RP_AN_GET) |
151 | { | 156 | { |
@@ -158,6 +163,11 @@ iterateDummy (void *cls, | |||
158 | else | 163 | else |
159 | crc->phase = RP_PUT; | 164 | crc->phase = RP_PUT; |
160 | } | 165 | } |
166 | GNUNET_SCHEDULER_add_after (crc->sched, | ||
167 | GNUNET_NO, | ||
168 | GNUNET_SCHEDULER_PRIORITY_KEEP, | ||
169 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | ||
170 | &test, crc); | ||
161 | return GNUNET_OK; | 171 | return GNUNET_OK; |
162 | } | 172 | } |
163 | crc->api->next_request (next_cls, | 173 | crc->api->next_request (next_cls, |
@@ -165,6 +175,7 @@ iterateDummy (void *cls, | |||
165 | return GNUNET_OK; | 175 | return GNUNET_OK; |
166 | } | 176 | } |
167 | 177 | ||
178 | |||
168 | static void | 179 | static void |
169 | test (void *cls, | 180 | test (void *cls, |
170 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 181 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index bcd5c7e2d..22e5df095 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -519,7 +519,7 @@ sqlite_next_request (void *next_cls, | |||
519 | { | 519 | { |
520 | static struct GNUNET_TIME_Absolute zero; | 520 | static struct GNUNET_TIME_Absolute zero; |
521 | struct NextContext * nc= next_cls; | 521 | struct NextContext * nc= next_cls; |
522 | struct Plugin *plugin = nc->plugin; | 522 | struct Plugin *plugin; |
523 | unsigned long long rowid; | 523 | unsigned long long rowid; |
524 | sqlite3_stmt *stmtd; | 524 | sqlite3_stmt *stmtd; |
525 | int ret; | 525 | int ret; |
@@ -531,6 +531,7 @@ sqlite_next_request (void *next_cls, | |||
531 | const GNUNET_HashCode *key; | 531 | const GNUNET_HashCode *key; |
532 | const void *data; | 532 | const void *data; |
533 | 533 | ||
534 | plugin = nc->plugin; | ||
534 | sqlite3_reset (nc->stmt); | 535 | sqlite3_reset (nc->stmt); |
535 | if ( (GNUNET_YES == end_it) || | 536 | if ( (GNUNET_YES == end_it) || |
536 | (GNUNET_YES == nc->end_it) || | 537 | (GNUNET_YES == nc->end_it) || |
@@ -784,7 +785,7 @@ iter_next_prepare (void *cls, | |||
784 | struct NextContext *nc) | 785 | struct NextContext *nc) |
785 | { | 786 | { |
786 | struct IterContext *ic = cls; | 787 | struct IterContext *ic = cls; |
787 | struct Plugin *plugin = nc->plugin; | 788 | struct Plugin *plugin; |
788 | int ret; | 789 | int ret; |
789 | 790 | ||
790 | if (nc == NULL) | 791 | if (nc == NULL) |
@@ -793,6 +794,7 @@ iter_next_prepare (void *cls, | |||
793 | sqlite3_finalize (ic->stmt_2); | 794 | sqlite3_finalize (ic->stmt_2); |
794 | return GNUNET_SYSERR; | 795 | return GNUNET_SYSERR; |
795 | } | 796 | } |
797 | plugin = nc->plugin; | ||
796 | if (ic->is_prio) | 798 | if (ic->is_prio) |
797 | { | 799 | { |
798 | sqlite3_bind_int (ic->stmt_1, 1, nc->lastPriority); | 800 | sqlite3_bind_int (ic->stmt_1, 1, nc->lastPriority); |