basho/eleveldb — pull request #16 by slfritchie (2012-02-13 21:13:34+00:00)
Title: Add rand_gen_1.erl to create key generators for basho_bench

... that can favor/punish LevelDB's SST file merging strategy.

For a key distribution that is very time series'ish given the current
wall clock time, and random values @ 10KB, there's the basho_bench
configuration snippet to use:

{key_generator, {function, rand_gen_1, mostly_sequential, [1]}}.
{value_generator, {function, rand_gen_1, random_bin, [10000]}}.

LevelDB likes such sorted keys very much. For something that is
less friendly to LevelDB, try:

{key_generator, {function, rand_gen_1, mostly_sequential, [100000]}}.

For something that makes LevelDB unhappy, use a pareto distribution
of 100 million keys, e.g.:

{key_generator, {function, rand_gen_1, pareto_as_bin, [100000000]}}.