struct CpsRunContext
{
- struct GNUNET_SCHEDULER_Handle *sched;
const struct GNUNET_CONFIGURATION_Handle *cfg;
enum RunPhase phase;
int j;
int i;
GNUNET_HashCode key;
- uint32_t esize;
+ size_t esize;
char data[65536];
};
else
crc->phase = RP_CUT;
}
- GNUNET_SCHEDULER_add_continuation (crc->sched,
- &run_continuation,
+ GNUNET_SCHEDULER_add_continuation (&run_continuation,
crc,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
}
fprintf (stderr, "D");
#endif
GNUNET_assert (GNUNET_OK == success);
- GNUNET_SCHEDULER_add_continuation (crc->sched,
- &run_continuation,
+ GNUNET_SCHEDULER_add_continuation (&run_continuation,
crc,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
}
static void
delete_value (void *cls,
const GNUNET_HashCode * key,
- uint32_t size,
+ size_t size,
const void *data,
enum GNUNET_BLOCK_Type type,
uint32_t priority,
if (stored_bytes < MAX_SIZE)
{
crc->phase = RP_REPORT;
- GNUNET_SCHEDULER_add_continuation (crc->sched,
- &run_continuation,
+ GNUNET_SCHEDULER_add_continuation (&run_continuation,
crc,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
return;
}
- GNUNET_SCHEDULER_add_with_priority (crc->sched,
- GNUNET_SCHEDULER_PRIORITY_HIGH,
+ GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_HIGH,
&do_delete,
crc);
return;
"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).value));
+ 1000 * stored_ops / (1 + GNUNET_TIME_absolute_get_duration(start_time).rel_value));
crc->phase = RP_PUT;
crc->j = 0;
- GNUNET_SCHEDULER_add_continuation (crc->sched,
- &run_continuation,
+ GNUNET_SCHEDULER_add_continuation (&run_continuation,
crc,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
GNUNET_free (crc);
return;
}
- GNUNET_SCHEDULER_add_continuation (crc->sched,
- &run_continuation,
+ GNUNET_SCHEDULER_add_continuation (&run_continuation,
crc,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
}
static void
run (void *cls,
- struct GNUNET_SCHEDULER_Handle *sched,
char *const *args,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
struct CpsRunContext *crc;
static GNUNET_HashCode zkey;
- datastore = GNUNET_DATASTORE_connect (cfg, sched);
+ datastore = GNUNET_DATASTORE_connect (cfg);
start_time = GNUNET_TIME_absolute_get ();
crc = GNUNET_malloc(sizeof(struct CpsRunContext));
- crc->sched = sched;
crc->cfg = cfg;
crc->phase = RP_PUT;
if (NULL ==
static int
check ()
{
- pid_t pid;
+ struct GNUNET_OS_Process *proc;
char cfg_name[128];
char *const argv[] = {
"perf-datastore-api",
sizeof (cfg_name),
"test_datastore_api_data_%s.conf",
plugin_name);
- pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
+ proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
"gnunet-service-arm",
#if VERBOSE
"-L", "DEBUG",
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
argv, "perf-datastore-api", "nohelp",
options, &run, NULL);
- if (0 != PLIBC_KILL (pid, SIGTERM))
+ if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
ok = 1;
}
- GNUNET_OS_process_wait(pid);
+ GNUNET_OS_process_wait (proc);
+ GNUNET_OS_process_close (proc);
+ proc = NULL;
return ok;
}