Skip to content

Commit 9bbfdf0

Browse files
committed
Address review comments (s'not random, is uniform)
1 parent b0acfa6 commit 9bbfdf0

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

examples/counters.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
{key_generator, {int_to_bin, {uniform_int, 10000}}}.
1010

11-
{value_generator, {random_int, 50}}.
11+
{value_generator, {uniform_int, 50}}.
1212

1313
{riakc_pb_ips, [{127,0,0,1}]}.
1414

rebar.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
{erl_opts, [{src_dirs, [src]},
3333
{parse_transform, lager_transform}]}.
3434

35-
{escript_incl_apps, [lager, getopt, bear, folsom, ibrowse, riakc, riak_pb, mochiweb, protobuffs, velvet]}.
35+
{escript_incl_apps, [lager, getopt, bear, folsom, ibrowse, riakc, mochiweb, protobuffs, velvet]}.
3636

3737
{escript_emu_args, "%%! +K true\n"}.
3838
%% Use this for the Java client bench driver

src/basho_bench_driver_2i.erl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,6 @@ to_list(B) when is_binary(B) ->
351351
to_list(I) when is_integer(I) ->
352352
integer_to_list(I).
353353

354-
choose(N, L) ->
355-
lists:nth((N rem length(L) + 1), L).
356-
357354
json_get(Url) ->
358355
Response = ibrowse:send_req(lists:flatten(Url), [], get),
359356
case Response of

src/basho_bench_valgen.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ new({function, Module, Function, Args}, Id) ->
5252
_Error ->
5353
?FAIL_MSG("Could not find valgen function: ~p:~p\n", [Module, Function])
5454
end;
55-
new({random_int, MaxSize}, _Id) ->
56-
fun() -> random:uniform(MaxSize) end;
55+
new({uniform_int, MaxVal}, _Id) ->
56+
fun() -> random:uniform(MaxVal) end;
57+
new({uniform_int, MinVal, MaxVal}, _Id) ->
58+
fun() -> random:uniform(MinVal, MaxVal) end;
5759
new(Other, _Id) ->
5860
?FAIL_MSG("Unsupported value generator requested: ~p\n", [Other]).
5961

0 commit comments

Comments
 (0)