Commit 650fb620 authored by Rob Latham's avatar Rob Latham
Browse files

the sds-keyval tests should work with mobject-server

... and they'll even pass once we have a bit more implemented
parent e5de3f68
/* the SDS-keyval and bake-bulk tests should still work, even if there is a higher-level protocol */
int main(int argc, char **argv)
mobject_server_register(argc, argv);
#include "sds-keyval.h"
#include <assert.h>
int main(int argc, char **argv) {
int ret;
kv_context * context = kv_client_register(argc, argv);
/* open */
ret = kv_open(context, argv[1], "booger", KV_INT, KV_INT);
/* put */
int key = 10;
int val = 10;
ret = kv_put(context, &key, &val);
/* get */
int remote_val;
ret = kv_get(context, &key, &remote_val);
printf("key: %d in: %d out: %d\n", key, val, remote_val);
/* close */
ret = kv_close(context);
/* benchmark doesn't require an open keyval */
bench_result *output;
output = kv_benchmark(context, 1000);
printf("insert: %zd keys in %f seconds: %f Million-insert per sec\n",
output->nkeys, output->insert_time,
output->nkeys/(output->insert_time*1024*1024) );
// kv_client_deregister(context);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment