3131-record (state , { pid ,
3232 bucket ,
3333 r ,
34+ pr ,
3435 w ,
3536 dw ,
37+ pw ,
3638 rw ,
3739 keylist_length ,
3840 preloaded_keys ,
@@ -75,6 +77,8 @@ new(Id) ->
7577 W = basho_bench_config :get (riakc_pb_w , Replies ),
7678 DW = basho_bench_config :get (riakc_pb_dw , Replies ),
7779 RW = basho_bench_config :get (riakc_pb_rw , Replies ),
80+ PW = basho_bench_config :get (riakc_pb_pw , Replies ),
81+ PR = basho_bench_config :get (riakc_pb_pr , Replies ),
7882 Bucket = basho_bench_config :get (riakc_pb_bucket , <<" test" >>),
7983 KeylistLength = basho_bench_config :get (riakc_pb_keylist_length , 1000 ),
8084 PreloadedKeys = basho_bench_config :get (
@@ -90,9 +94,11 @@ new(Id) ->
9094 {ok , # state { pid = Pid ,
9195 bucket = Bucket ,
9296 r = R ,
97+ pr = PR ,
9398 w = W ,
9499 dw = DW ,
95100 rw = RW ,
101+ pw = PW ,
96102 keylist_length = KeylistLength ,
97103 preloaded_keys = PreloadedKeys ,
98104 timeout_general = get_timeout_general (),
@@ -234,8 +240,32 @@ run(mr_keylist_erlang, KeyGen, _ValueGen, State) ->
234240 mapred (State , Keylist , ? ERLANG_MR );
235241run (mr_keylist_js , KeyGen , _ValueGen , State ) ->
236242 Keylist = make_keylist (State # state .bucket , KeyGen ,
237- State # state .keylist_length ),
238- mapred (State , Keylist , ? JS_MR ).
243+ State # state .keylist_length ),
244+ mapred (State , Keylist , ? JS_MR );
245+ run (counter_incr , KeyGen , ValueGen , State ) ->
246+ Amt = ValueGen (),
247+ Key = KeyGen (),
248+ case riakc_pb_socket :counter_incr (State # state .pid , State # state .bucket , Key , Amt ,
249+ [{w , State # state .w },
250+ {dw , State # state .dw },
251+ {pw , State # state .pw }]) of
252+ ok ->
253+ {ok , State };
254+ {error , Reason } ->
255+ {error , Reason , State }
256+ end ;
257+ run (counter_val , KeyGen , _ValueGen , State ) ->
258+ Key = KeyGen (),
259+ case riakc_pb_socket :counter_val (State # state .pid , State # state .bucket , Key ,
260+ [{r , State # state .r }, {pr , State # state .pr }]) of
261+ {ok , _N } ->
262+ {ok , State };
263+ {error , notfound } ->
264+ {ok , State };
265+ {error , Reason } ->
266+ {error , Reason , State }
267+ end .
268+
239269
240270% % ====================================================================
241271% % Internal functions
0 commit comments