Skip to content

Instantly share code, notes, and snippets.

@moonpolysoft
Created March 13, 2009 21:51
Show Gist options
  • Save moonpolysoft/78789 to your computer and use it in GitHub Desktop.
Save moonpolysoft/78789 to your computer and use it in GitHub Desktop.
test_membership_server_throughput() ->
{timeout, 500, {?LINE, fun() ->
{ok, _} = membership:start_link(a, [a,b,c,d,e,f]),
{Keys, _} = lib_misc:fast_acc(fun({List, Str}) ->
Mod = lib_misc:succ(Str),
{[Mod|List], Mod}
end, {[], "aaaaaaaa"}, 10000),
Start = lib_misc:now_float(),
lists:foreach(fun(Str) ->
membership:servers_for_key(Str)
end, Keys),
End = lib_misc:now_float(),
?debugFmt("membership can do ~p reqs/s", [10000/(End-Start)])
end}}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment