Created
April 6, 2009 16:14
-
-
Save moonpolysoft/90812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_storage_server_throughput() -> | |
configuration:start_link(#config{}), | |
{ok, Pid} = storage_server:start_link(ets_storage, db_key(throughput), through, 0, (2 bsl 31), undefined), | |
{Keys, _} = lib_misc:fast_acc(fun({List, Str}) -> | |
Mod = lib_misc:succ(Str), | |
{[Mod|List], Mod} | |
end, {[], "aaaaaaaa"}, 10000), | |
Vector = vector_clock:create(a), | |
Start = lib_misc:now_float(), | |
lists:foreach(fun(Key) -> | |
storage_server:put(Pid, Key, Vector, Key) | |
end, Keys), | |
lists:foreach(fun(Key) -> | |
storage_server:get(Pid, Key) | |
end, Keys), | |
End = lib_misc:now_float(), | |
?debugFmt("storage server can do ~p reqs/s", [20000/(End-Start)]), | |
storage_server:close(Pid). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment