2014-04-09 00:26:37 +00:00
|
|
|
-module(consistent_get_put).
|
|
|
|
-compile(export_all).
|
|
|
|
-include_lib("eunit/include/eunit.hrl").
|
|
|
|
|
|
|
|
-define(HARNESS, (rt_config:get(rt_harness))).
|
|
|
|
|
|
|
|
confirm() ->
|
|
|
|
HostList = rt_config:get(rt_hostnames),
|
|
|
|
Count = length(HostList),
|
2014-07-15 17:18:39 +00:00
|
|
|
BinSize = rt_config:get(perf_bin_size),
|
2014-04-09 00:26:37 +00:00
|
|
|
|
2014-04-16 00:33:06 +00:00
|
|
|
Config = rtperf:standard_config(Count),
|
2014-07-15 17:18:39 +00:00
|
|
|
lager:info("Generated configuration is: ~p", [Config]),
|
2014-04-09 00:26:37 +00:00
|
|
|
|
2014-07-15 17:18:39 +00:00
|
|
|
[Nodes] = rt:build_clusters([Count]),
|
|
|
|
lager:info("Built cluster: ~p", [Nodes]),
|
2014-04-18 22:52:27 +00:00
|
|
|
|
2014-04-16 00:33:06 +00:00
|
|
|
SetSize = rtperf:target_size(rt_config:get(perf_target_pct),
|
|
|
|
BinSize,
|
|
|
|
rt_config:get(perf_ram_size),
|
|
|
|
Count),
|
|
|
|
[Node | _] = Nodes,
|
2014-07-15 17:18:39 +00:00
|
|
|
rt:create_and_activate_bucket_type(Node,
|
|
|
|
<<"sc">>,
|
|
|
|
[{consistent, true}]),
|
2014-04-16 00:33:06 +00:00
|
|
|
|
2014-04-18 22:52:27 +00:00
|
|
|
TestConfig =
|
2014-04-16 00:33:06 +00:00
|
|
|
rt_bench:config(
|
2014-04-18 22:52:27 +00:00
|
|
|
max,
|
2014-04-16 00:33:06 +00:00
|
|
|
rt_config:get(perf_duration),
|
2014-07-15 17:18:39 +00:00
|
|
|
[{Host, 10017} || Host <- HostList],
|
|
|
|
{int_to_bin_bigendian, {truncated_pareto_int, SetSize}},
|
2014-04-16 00:33:06 +00:00
|
|
|
rt_bench:valgen(rt_config:get(perf_bin_type), BinSize),
|
|
|
|
%% 4:1 get/put
|
|
|
|
[{get, 3}, {update, 1}],
|
2014-07-15 17:18:39 +00:00
|
|
|
{<<"sc">>, <<"testbucket">>},
|
|
|
|
riakc_pb),
|
2014-04-16 00:33:06 +00:00
|
|
|
|
2014-07-15 17:18:39 +00:00
|
|
|
ok = rtperf:maybe_prepop(Nodes, BinSize, SetSize),
|
2014-04-16 00:33:06 +00:00
|
|
|
|
2014-07-15 17:18:39 +00:00
|
|
|
ok = rtperf:run_test(Nodes, TestConfig, []),
|
2014-04-16 00:33:06 +00:00
|
|
|
pass.
|