anchor.diff:  new_bytes(Size) ->
     << << N:8 >> || N <- lists:map(fun(_) -> random:uniform(256) end, lists:seq(1,Size)) >>.
     
  -worker_loop(Method, Client, File, Data, Ratio, Host) ->
  -  {Key,Value} = array:get(random:uniform(array:size(Data))-1, Data),
  +worker_loop(Method, Client, File, Data, Ratio, Host, Keyspace) ->
  +  [{_,Key,Value}] = ets:lookup(Data, random:uniform(Keyspace)),
     Start = lib_misc:now_float(),
     Result = (catch call_server(Method, random:uniform(), Ratio, Client, Key, Value)),
     End = lib_misc:now_float(),
  
positive.code:     end),
    spawn_workers(Data, Config, Hosts, N-1).
    
  worker(#config{logdir=Logdir,ratio=Ratio,method=Method}, Host, Data) ->
    io:format("starting worker for ~p~n", [Host]),
    {Mega, Sec, Micro} = now(),
    random:seed(Mega, Sec, Micro),
    Filename = filename:join(Logdir, pid_to_list(self()) ++ "_" ++ Host ++ ".log"),
    {ok, File} = file:open(Filename, [write, raw]),
    [Hostname, StrPort] = string:tokens(Host, ":"),
    Port = list_to_integer(StrPort),
    {ok, Client} = case Method of
      thrift -> dynomite_thrift_client:start_link(Hostname, Port);
      rpc -> {ok, list_to_atom("dynomite@" ++ Hostname)}
    end,
    worker_loop(Method, Client, File, Data, Ratio, Host).
    
  generate_test_data(Keyspace, Size) ->
    A = array:new(Keyspace),
    Keychars = lib_misc:ceiling(math:log(Keyspace) / math:log(26)),
    Key = duplicate(Keychars, $a),
    generate_test_data(Keyspace, Key, Size, A).
  
negative.code: generate_test_data(0, _, _, A) -> A;
    
  generate_test_data(N, Key, Size, A) ->
    ets:insert(A, {N, Key, new_bytes(Size)}),
    generate_test_data(N-1, lib_misc:succ(Key), Size, A).
    
  duplicate(N, E) ->
    duplicate(N, E, []).
  