#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_datastore_service.h"
-#include "gnunet_testing_lib-new.h"
+#include "gnunet_testing_lib.h"
#include <gauger.h>
/**
static void
-delete_value (void *cls, const GNUNET_HashCode * key, size_t size,
+delete_value (void *cls, const struct GNUNET_HashCode * key, size_t size,
const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority,
uint32_t anonymity, struct GNUNET_TIME_Absolute expiration,
uint64_t uid)
{
struct CpsRunContext *crc = cls;
size_t size;
- static GNUNET_HashCode key;
+ static struct GNUNET_HashCode key;
static char data[65536];
int i;
int k;
switch (crc->phase)
{
case RP_PUT:
- memset (&key, 256 - crc->i, sizeof (GNUNET_HashCode));
+ memset (&key, 256 - crc->i, sizeof (struct GNUNET_HashCode));
i = crc->j;
k = crc->i;
/* most content is 32k */
if (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16) == 0) /* but some of it is less! */
size = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 32 * 1024);
crc->size = size = size - (size & 7); /* always multiple of 8 */
- GNUNET_CRYPTO_hash (&key, sizeof (GNUNET_HashCode), &key);
+ GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &key);
memset (data, i, size);
if (i > 255)
memset (data, i - 255, size / 2);
#endif
"Stored %llu kB / %lluk ops / %llu ops/s\n", stored_bytes / 1024, /* used size in k */
stored_ops / 1024, /* total operations (in k) */
- 1000 * stored_ops / (1 +
- GNUNET_TIME_absolute_get_duration
- (start_time).rel_value));
+ 1000LL * 1000LL * stored_ops / (1 +
+ GNUNET_TIME_absolute_get_duration
+ (start_time).rel_value_us));
crc->phase = RP_PUT;
crc->j = 0;
GNUNET_SCHEDULER_add_continuation (&run_continuation, crc,
GNUNET_snprintf (gstr, sizeof (gstr), "DATASTORE-%s", plugin_name);
if ((crc->i == ITERATIONS) && (stored_ops > 0))
GAUGER (gstr, "PUT operation duration",
- GNUNET_TIME_absolute_get_duration (start_time).rel_value /
+ GNUNET_TIME_absolute_get_duration (start_time).rel_value_us / 1000LL /
stored_ops, "ms/operation");
GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
GNUNET_free (crc);
static void
-run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg)
+run (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
{
struct CpsRunContext *crc;
- static GNUNET_HashCode zkey;
+ static struct GNUNET_HashCode zkey;
datastore = GNUNET_DATASTORE_connect (cfg);
start_time = GNUNET_TIME_absolute_get ();
{
char cfg_name[128];
- plugin_name = GNUNET_TESTING_get_testname_from_underscoare (argv[0]);
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name),
"test_datastore_api_data_%s.conf", plugin_name);
if (0 !=
&run,
NULL))
return 1;
+ FPRINTF (stderr, "%s", "\n");
return ok;
}