diff options
Diffstat (limited to 'src/datacache')
-rw-r--r-- | src/datacache/perf_datacache.c | 4 | ||||
-rw-r--r-- | src/datacache/plugin_datacache_heap.c | 4 | ||||
-rw-r--r-- | src/datacache/plugin_datacache_postgres.c | 4 | ||||
-rw-r--r-- | src/datacache/plugin_datacache_sqlite.c | 12 | ||||
-rw-r--r-- | src/datacache/test_datacache.c | 2 | ||||
-rw-r--r-- | src/datacache/test_datacache_quota.c | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index 84775a314f..027999d224 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c @@ -96,7 +96,7 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (start), GNUNET_YES)); GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name); GAUGER (gstr, "Time to PUT item in datacache", - GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, + GNUNET_TIME_absolute_get_duration (start).rel_value_us / 1000LL / ITERATIONS, "ms/item"); start = GNUNET_TIME_absolute_get (); memset (&k, 0, sizeof (struct GNUNET_HashCode)); @@ -116,7 +116,7 @@ run (void *cls, char *const *args, const char *cfgfile, ITERATIONS - found); if (found > 0) GAUGER (gstr, "Time to GET item from datacache", - GNUNET_TIME_absolute_get_duration (start).rel_value / found, + GNUNET_TIME_absolute_get_duration (start).rel_value_us / 1000LL / found, "ms/item"); GNUNET_DATACACHE_destroy (h); ASSERT (ok == 0); diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c index 41dd089746..aee6cd5b89 100644 --- a/src/datacache/plugin_datacache_heap.c +++ b/src/datacache/plugin_datacache_heap.c @@ -182,7 +182,7 @@ put_cb (void *cls, put_ctx->path_info_len * sizeof (struct GNUNET_PeerIdentity)); GNUNET_CONTAINER_heap_update_cost (put_ctx->heap, val->hn, - val->discard_time.abs_value); + val->discard_time.abs_value_us); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got same value for key %s and type %d (size %u vs %u)\n", GNUNET_h2s (key), @@ -250,7 +250,7 @@ heap_plugin_put (void *cls, const struct GNUNET_HashCode * key, size_t size, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); val->hn = GNUNET_CONTAINER_heap_insert (plugin->heap, val, - val->discard_time.abs_value); + val->discard_time.abs_value_us); return size + OVERHEAD; } diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c index e7d2e72c27..c8d66ead1c 100644 --- a/src/datacache/plugin_datacache_postgres.c +++ b/src/datacache/plugin_datacache_postgres.c @@ -176,7 +176,7 @@ postgres_plugin_put (void *cls, const struct GNUNET_HashCode * key, size_t size, struct Plugin *plugin = cls; PGresult *ret; uint32_t btype = htonl (type); - uint64_t bexpi = GNUNET_TIME_absolute_hton (discard_time).abs_value__; + uint64_t bexpi = GNUNET_TIME_absolute_hton (discard_time).abs_value_us__; const char *paramValues[] = { (const char *) &btype, @@ -277,7 +277,7 @@ postgres_plugin_get (void *cls, const struct GNUNET_HashCode * key, } for (i = 0; i < cnt; i++) { - expiration_time.abs_value = + expiration_time.abs_value_us = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i, 0)); type = ntohl (*(uint32_t *) PQgetvalue (res, i, 1)); size = PQgetlength (res, i, 2); diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c index bf76f310f1..34aa613630 100644 --- a/src/datacache/plugin_datacache_sqlite.c +++ b/src/datacache/plugin_datacache_sqlite.c @@ -116,7 +116,7 @@ sqlite_plugin_put (void *cls, "Processing `%s' of %u bytes with key `%4s' and expiration %s\n", "PUT", (unsigned int) size, GNUNET_h2s (key), GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (discard_time), GNUNET_YES)); - dval = (int64_t) discard_time.abs_value; + dval = (int64_t) discard_time.abs_value_us; if (dval < 0) dval = INT64_MAX; if (sq_prepare @@ -203,13 +203,13 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key, "sq_prepare"); return 0; } - ntime = (int64_t) now.abs_value; + ntime = (int64_t) now.abs_value_us; GNUNET_assert (ntime >= 0); if ((SQLITE_OK != sqlite3_bind_blob (stmt, 1, key, sizeof (struct GNUNET_HashCode), SQLITE_TRANSIENT)) || (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) || - (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value))) + (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value_us))) { LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, "sqlite3_bind_xxx"); @@ -256,7 +256,7 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key, sqlite3_bind_blob (stmt, 1, key, sizeof (struct GNUNET_HashCode), SQLITE_TRANSIENT)) || (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) || - (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value))) + (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value_us))) { LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, "sqlite3_bind_xxx"); @@ -267,7 +267,7 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key, break; size = sqlite3_column_bytes (stmt, 0); dat = sqlite3_column_blob (stmt, 0); - exp.abs_value = sqlite3_column_int64 (stmt, 1); + exp.abs_value_us = sqlite3_column_int64 (stmt, 1); psize = sqlite3_column_bytes (stmt, 2); if (0 != psize % sizeof (struct GNUNET_PeerIdentity)) { @@ -279,7 +279,7 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key, path = sqlite3_column_blob (stmt, 2); else path = NULL; - ntime = (int64_t) exp.abs_value; + ntime = (int64_t) exp.abs_value_us; if (ntime == INT64_MAX) exp = GNUNET_TIME_UNIT_FOREVER_ABS; cnt++; diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c index 8c429cc7a0..071ae721fb 100644 --- a/src/datacache/test_datacache.c +++ b/src/datacache/test_datacache.c @@ -80,7 +80,7 @@ run (void *cls, char *const *args, const char *cfgfile, return; } exp = GNUNET_TIME_absolute_get (); - exp.abs_value += 5 * 60 * 1000; + exp.abs_value_us += 5 * 60 * 1000 * 1000LL; memset (&k, 0, sizeof (struct GNUNET_HashCode)); for (i = 0; i < 100; i++) { diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c index 0400b50511..877c62a3f6 100644 --- a/src/datacache/test_datacache_quota.c +++ b/src/datacache/test_datacache_quota.c @@ -71,7 +71,7 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); for (j = i; j < sizeof (buf); j += 10) { - exp.abs_value++; + exp.abs_value_us++; buf[j] = i; ASSERT (GNUNET_OK == GNUNET_DATACACHE_put (h, &k, j, buf, 1 + i, exp, 0, NULL)); ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL)); |