Skip to content

Instantly share code, notes, and snippets.

@dreverri
Created January 3, 2012 02:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dreverri/1553109 to your computer and use it in GitHub Desktop.
Save dreverri/1553109 to your computer and use it in GitHub Desktop.
module(custom_gen).
-export([key/1,
value/1,
key_from_arg/2,
value_from_arg/2
]).
key(_Id) ->
fun() -> <<"custom_key">> end.
value(_Id) ->
fun() -> <<"custom_value">> end.
key_from_arg(_Id, Arg) ->
fun() -> Arg end.
value_from_arg(_Id, Arg) ->
fun() -> Arg end.
{mode, max}.
{duration, 10}.
{concurrent, 1}.
{driver, basho_bench_driver_riakc_pb}.
{riakc_pb_ips, [{127,0,0,1}]}.
{riakc_pb_replies, 1}.
{operations, [{get, 1}, {update, 1}]}.
{source_dir, "src"}.
%% Example using a custom function for key and value generation
{key_generator, {function, custom_gen, key, []}}.
{value_generator, {function, custom_gen, value, []}}.
%% Example using a custom function with args
%% {key_generator, {function, custom_gen, key_from_arg, [<<"key_arg">>]}}.
%% {value_generator, {function, custom_gen, value_from_arg, [<<"value_arg">>]}}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment