anchor.diff:      {ok, Type} -> file:write(File, io_lib:format("~p\t~s\t~p\t~s\t~s~n", [End, Type, End - Start, Key, Host]));
       {'EXIT', _} -> file:write(File, io_lib:format("~p\terror\t~p\t~s\t~s~n", [End, End - Start, Key, Host]))
     end,
  -  worker_loop(Method, Client, File, Data, Ratio, Host).
  +  worker_loop(Method, Client, File, Data, Ratio, Host, Keyspace).
   
   call_server(rpc, Rand, Ratio, Host, Key, Value) when Rand < Ratio ->
  -  rpc:call(Host, mediator, put, [Key, undefined, Value]),
  -  {ok, "put"};
  +  case rpc:call(Host, mediator, put, [Key, {self(), undefined}, Value]) of
  +    {badrpc, Reason} -> {'EXIT', Reason};
  +    Res -> {ok, "put"}
  +  end;
     
   call_server(rpc, _, _, Host, Key, _) ->
  -  rpc:call(Host, mediator, get, [Key]),
  -  {ok, "get"};
  +  case rpc:call(Host, mediator, get, [Key]) of
  +    {badrpc, Reason} -> {'EXIT', Reason};
  +    Res -> {ok, "get"}
  +  end;
   
   call_server(thrift, Rand, Ratio, Client, Key, Value) when Rand < Ratio ->
     dynomite_thrift_client:put(Client, Key, undefined, Value),
  
positive.code: #!/usr/bin/env escript
  %% -*- erlang -*-
  %%! +K true +A 128 +P 60000 -smp enable -sname benchmark -pa ./ebin -pa ./deps/thrift/ebin
  -mode(compile).
  
  -record(config, {hosts=[],concurrency=20,ratio=0.5,logdir="bench_log",size=100,keyspace=100000,method=thrift}).
  
  main(Options) ->
    code:add_pathsa(["./ebin", "./deps/thrift/ebin"]),
    process_flag(trap_exit, true),
    case parse_options(Options) of
  
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, []).
  