diff options
Diffstat (limited to 'test/mem3_cache_bench.erl')
-rw-r--r-- | test/mem3_cache_bench.erl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/mem3_cache_bench.erl b/test/mem3_cache_bench.erl new file mode 100644 index 00000000..a78f029d --- /dev/null +++ b/test/mem3_cache_bench.erl @@ -0,0 +1,29 @@ +-module (mem3_cache_bench). + +-export ([doit/1]). + +-include("../include/config.hrl"). + + +init() -> + Config = #config{n=3,r=2,w=2,q=3,directory="/srv/db", + storage_mod="dynomite_couch_storage"}, + {ok, _Pid} = mem3:start_link([{test,true}, {config, Config}]), + mem3:join(first, [{1, a, []}, {2, b, []}]). + + +doit(Reps) -> + init(), + Begin = erlang:now(), + process(Reps), + % seconds to run the test + Time = timer:now_diff(erlang:now(), Begin)/1000000, + mem3:stop(), + Time. + + +process(0) -> + ok; +process(M) -> + mem3:fullmap(), + process(M-1). |