forked from basho/riak_test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consistent_get_put.erl
42 lines (34 loc) · 1.34 KB
/
consistent_get_put.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-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),
BinSize = rt_config:get(perf_bin_size),
Config = rtperf:standard_config(Count),
lager:info("Generated configuration is: ~p", [Config]),
[Nodes] = rt:build_clusters([Count]),
lager:info("Built cluster: ~p", [Nodes]),
SetSize = rtperf:target_size(rt_config:get(perf_target_pct),
BinSize,
rt_config:get(perf_ram_size),
Count),
[Node | _] = Nodes,
rt:create_and_activate_bucket_type(Node,
<<"sc">>,
[{consistent, true}]),
TestConfig =
rt_bench:config(
max,
rt_config:get(perf_duration),
[{Host, 10017} || Host <- HostList],
{int_to_bin_bigendian, {truncated_pareto_int, SetSize}},
rt_bench:valgen(rt_config:get(perf_bin_type), BinSize),
%% 4:1 get/put
[{get, 3}, {update, 1}],
{<<"sc">>, <<"testbucket">>},
riakc_pb),
ok = rtperf:maybe_prepop(Nodes, BinSize, SetSize),
ok = rtperf:run_test(Nodes, TestConfig, []),
pass.